#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
ITP1_7-A
Structured Program II - Grading
????????¶??? : 1 sec, ?????¢?????¶??? : 65536 KB
??????

????????????????????????????????????????????°????????????????????????????????°??????????????????????????¨??§??????

????????°??????????????°?????????????????????????????°????????????????????????

?????????????????°????????????????¨?????????° m?????????????¨?????????° f??????????¨?????????° r ??§?§?????????????????????????

??????????¨???¨??????????¨???? 50 ????????????m, f ??? 50?????????????¨???? 100 ????????? ???r ??? 100?????§??????

????¨????????????????????????´???????????°??? -1 ??¨????????????

??\??????????????§??????????????????????????????

    ??????????¨??????????????¨????????????????????¬????????????´???????????? F???
    ??????????¨???¨??????????¨????????¨??????°??? 80 ??\???????????°????????? A ???
    ??????????¨???¨??????????¨????????¨??????°??? 65 ??\??? 80 ??????????????°????????? B???
    ??????????¨???¨??????????¨????????¨??????°??? 50 ??\??? 65 ??????????????°????????? C???
    ??????????¨???¨??????????¨????????¨??????°??? 30 ??\??? 50 ??????????????°????????? D??? ???????????????????¨?????????°??? 50 ??\???????????°????????? C???
    ??????????¨???¨??????????¨????????¨??????°??? 30 ??????????????°????????? F???

Input

?????°??????????????????????????\?????¨??????????????????????????????????????????????????§??????????????§??????????????? m???f???r ??? 1 ???????????????????????????

m???f???r ???????????? -1 ?????¨?????\?????????????????¨????????????
Output

?????????????????????????????????????????????A???B???C???D???????????? F???????????????????????????????????????
Sample Input

40 42 -1
20 30 -1
0 2 -1
-1 -1 -1

Sample Output

A
C
F

=end
while gets
  fl = $_.chomp.split.map{|x| x.to_i}
  m = fl[0]
  f = fl[1]
  r = fl[2]
  if m==-1 and f==-1 and r==-1 then break
    elsif m==-1 or f==-1 then rst="F"
    elsif m + f >=80 then rst="A"
    elsif m + f >=65 then rst="B"
    elsif m + f >=50 then rst="C"
    elsif m + f >=30 and r>=50 then rst="C"
    elsif m + f >=30 then rst="D"
    else  rst="F"
  end
  puts rst
end