while True:

    m,f,r = list(map(int, input().split()))

    if m == -1 and f == -1 and r == -1:

        break

    else:

        if m == -1 or f == -1:

            print("F")

        elif m + f >= 80:

            print("A")

        elif m + f < 80 and m + f >= 65:

            print("B")

        elif m + f < 65 and m + f >= 50:

            print("C")

        elif m + f < 50 and m + f >= 30 and r >= 50:

            print("C")

        elif m + f < 30:

            print("F")

        else:

            print("D")
while True:

    m,f,r = list(map(int, input().split()))

    if m == -1 and f == -1 and r == -1:

        break

    else:

        if m == -1 or f == -1:

            print("F")

        elif m + f >= 80:

            print("A")

        elif m + f >= 65:

            print("B")

        elif  m + f >= 50:

            print("C")

        elif  m + f >= 30 and r >= 50:

            print("C")

        elif m + f < 30:

            print("F")

        else:

            print("D")
while True:
    m, f, r = list(map(int, input().split()))
    if m == -1 and f == -1 and r == -1:
        break
    else:
        if m == -1 or f == -1:
            print("F")
        elif m + f >= 80:
            print("A")
        elif m + f < 80 and m + f >= 65:
            print("B")
        elif m + f < 65 and m + f >= 50:
            print("C")
        elif m + f < 50 and m + f >= 30 and r >= 50:
            print("C")
        elif m + f < 30:
            print("F")
        else:
            print("D")

while True:
    m, f, r = list(map(int, input().split()))
    if m == -1 and f == -1 and r == -1:
        break
    else:
        if m == -1 or f == -1:
            print("F")
        elif m + f >= 80:
            print("A")
        elif m + f >= 65:
            print("B")
        elif m + f >= 50:
            print("C")
        elif m + f >= 30 and r >= 50:
            print("C")
        elif m + f < 30:
            print("F")
        else:
            print("D")

-        elif m + f < 80 and m + f >= 65: +        elif m + f >= 65: -        elif m + f < 65 and m + f >= 50: +        elif m + f >= 50: -        elif m + f < 50 and m + f >= 30 and r >= 50: +        elif m + f >= 30 and r >= 50: