while line = gets
  m, f, r = line.chomp.split.map(&:to_i)
  break if m == -1 && f == -1 && r == -1

  if m == -1 || f == -1
    puts "F"
    next
  end

  mf = m + f
  if mf >= 80
    puts "A"
    next
  end

  if mf >= 65 && mf < 80
    puts "B"
    next
  end

  if mf >= 50 && mf < 65
    puts "C"
    next
  end

  if mf >= 30 && mf < 50
    if r >= 50
      puts "C"
    else
      puts "D"
    end
    next
  end

  if mf < 30
    puts "F"
    next
  end
end

