a = Array.new
loop do
    m, f, r = gets.split().map(&:to_i)
    if m == -1 and  f == -1 and r == -1
        break
    elsif (m == -1 or f == -1) or (m + f < 30)
        a.push("F")
    elsif m + f >= 80
        a.push("A")
    elsif m + f >= 65 and m + f < 80
        a.push("B")
    elsif m + f >= 50 and m + f < 65
        a.push("C")
    elsif m + f >= 30 and m + f < 50
        if r >= 50
            a.push("C")
        else
            a.push("D")
        end
    end
end

puts a