def judgeResult(mid,fin,ret)
        return "F" if mid == -1 || fin==-1
        sum=mid+fin
        if sum>=80
                "A"
        elsif sum>=65
                "B"
        elsif sum>=50
                "C"
        elsif sum>=30
                ret>=50?"C":"D"
        else
                "F"
        end
end
while buf = gets
        buf = buf.chomp.split(' ').map(&:to_i)
        break if buf == [-1,-1,-1]

        mid = buf[0]
        fin = buf[1]
        ret = buf[2]

        res=judgeResult(mid,fin,ret)
        puts res
end