while line = gets do
  m,f,r = line.chomp.split(" ").map{|x| x.to_i}
  if m==-1 && f==-1 && r==-1
    break
  end
  if m==-1 || f==-1
    print "F\n"
  elsif m+f >= 80
    print "A\n"
  elsif m+f >= 65
    print "B\n"
  elsif m+f >= 50
    print "C\n"
  elsif m+f >= 30
    if r >= 50
      print "C\n"
    else
      print "D\n"
    end
  else
    print "F\n"
  end
end
