
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
avg=(a+b+c+d+e)/5
if(avg>=90):
    grade='A'
elif(avg>=80):
    grade='B'
elif(avg>=70):
    grade='B'
elif(avg>=60):
    grade='B'
else:
    grade='F'
print(grade)        
