This page is still under construction.

Parts of this page are still being built. What you see may change.

Grading

Time limit1sMemory limit1024 MB

Summary
Given counts of satisfied A, C, and E criteria, print the grade from E up to A using the half-threshold rules for D and B.
Level

Easy2 of 10

Topics
Implementation, Math, Greedy
Solved
No attempts yet

Problem

Pelle is a programming teacher at Pelles Optimeringsskola (PO-skolan). He is now grading his students in the course Optimering 1.

Grading works as follows. There are xx A criteria, yy C criteria, and zz E criteria in use. To receive the grade E, a student must satisfy all E criteria. To receive the grade C, a student must satisfy all C and E criteria. To receive the grade A, a student must satisfy all A, C, and E criteria.

There are also two special grades. If a student satisfies all E criteria and at least half of the C criteria, the student receives a D. If a student satisfies all E and C criteria and at least half of the A criteria, the student receives a B.

Pelle finds grading very tedious and needs your help. Write a program that takes the number of A, C, and E criteria a student has satisfied and prints the grade the student should receive. You may assume the student always received at least E in the course.

Input

The first line contains three integers 1≤x≤301 \leq x \leq 30, 1≤y≤301 \leq y \leq 30, and 1≤z≤301 \leq z \leq 30, the number of A, C, and E criteria that exist. The second line contains three integers 0≤x′≤x0 \leq x' \leq x, 0≤y′≤y0 \leq y' \leq y, and 0≤z′≤z0 \leq z' \leq z, the number of A, C, and E criteria the student has satisfied.

Output

The program should print a single letter: A, B, C, D, or E.

Hint

In sample case 1, the student satisfies every criterion except one A criterion. The student therefore receives a B.

In sample case 2, the student satisfies all E criteria but not half of the C criteria. The student therefore receives an E.

Examples2

  1. Example 1

    Input
    10 10 10
    9 10 10
    
    Expected output
    B
    
  2. Example 2

    Input
    10 10 10
    0 4 10
    
    Expected output
    E