point = int(input())
if 90<=point<=100:
    print("AA")
elif 85<=point<90:
    print("BA")
elif 80<=point<85:
    print("BB")
elif 75<=point<80:
    print("CB")
elif 70<=point<75:
    print("CC")
elif 65<=point<70:
    print("DC")
elif 60<=point<65:
    print("DD")
elif 50<=point<60:
    print("FD")
elif 0<=point<50:
    print("FF")

point = int(input())
if 90<=point<=100:
    print("AA")
elif 85<=point<90:
    print("BA")
elif 80<=point<85:
    print("BB")
elif 75<=point<80:
    print("CB")
elif 70<=point<75:
    print("CC")
elif 65<=point<70:
    print("DC")
elif 60<=point<65:
    print("DD")
elif 50<=point<60:
    print("FD")
elif 0<=point<50:
    print("FF")
