def f?(m, f)
  if m ==  -1 || f == -1
    true
  elsif m + f < 30
    true
  else
    false
  end
end

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

  case
  when f?(m, f) then puts 'F'
  when m + f >= 80 then puts 'A'
  when m + f <  80 && m + f >= 65 then puts 'B'
  when m + f <  65 && m + f >= 50 then puts 'C'
  else
    if r >= 50
      puts 'C'
    else
      puts 'D'
    end
  end
end