loop do
  m, f, r = gets.split.map(&:to_i)
  break if m == -1 && f == -1 && r == -1
  if m == -1 || f == -1
    puts 'F'
  else
    case m + f
    when 80..100
      puts 'A'
    when 65..79
      puts 'B'
    when 50..64
      puts 'C'
    when 30..49
      if 50 <= r
        puts 'C'
      else
        puts 'D'
      end
    when 0..29
      puts 'F'
    end
  end
end