loop do
  m,f,r = gets.split.map(&:to_i)
  exit(0) if [m,f,r].all?{|x| x==-1}

  case
  when m==-1 || f==-1
    puts ?F
  when m+f>=80
    puts ?A
  when m+f>=65
    puts ?B
  when m+f>=50
    puts ?C
  when m+f>=30
    if r>=50
      puts ?C
    else
      puts ?D
    end
  else
    puts ?F
  end
end