loop do
    m,f,r = gets.split.map(&:to_i)
    break if m == -1 && f == -1 && r == -1
    x = m + f
    if m == -1 || f == -1 then
        puts 'F'
    elsif x >= 80 then
        puts 'A'
    elsif x >= 65 then
        puts 'B'
    elsif x >= 50 then
        puts 'C'
    elsif x >= 30 then
        if r >= 50 then
            puts 'C'
        else
            puts 'D'
        end
    else
        puts 'F'
    end
end
