import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        short[][] st = new short[50][3];
        short counter=0;
        short mid, last, add;
        while(true){
            mid = scanner.nextShort();
            last = scanner.nextShort();
            add = scanner.nextShort();
            if(mid == -1&&last == -1&&add == -1)break;
            st[counter][0] = mid;
            st[counter][1] = last;
            st[counter][2] = add;
            counter++;
        }
        int sum;
        for(int i = 0; i < counter; i++){
            sum = st[i][0]+st[i][1];
            if(st[i][0] == -1 || st[i][1] == -1){
                System.out.println("F");
                continue;
            }
            if(sum >= 80)System.out.println("A");
            else if(sum >= 65)System.out.println("B");
            else if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F");
        }
    }
}
 import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        short[][] st = new short[50][3];
        short counter=0;
        short mid, last, add;
        while(true){
            mid = scanner.nextShort();
            last = scanner.nextShort();
            add = scanner.nextShort();
            if(mid == -1&&last == -1&&add == -1)break;
            st[counter][0] = mid;
            st[counter][1] = last;
            st[counter][2] = add;
            counter++;
        }
        int sum;
        for(int i = 0; i < counter; i++){
            sum = st[i][0]+st[i][1];
            if(st[i][0] == -1 || st[i][1] == -1){
                System.out.println("F");
                continue;
            }
            if(sum >= 80)System.out.println("A");
            else if(sum >= 65)System.out.println("B");
            else if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F");
        }
    }
} Main public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        short[][] st = new short[50][3];
        short counter=0;
        short mid, last, add;
        while(true){
            mid = scanner.nextShort();
            last = scanner.nextShort();
            add = scanner.nextShort();
            if(mid == -1&&last == -1&&add == -1)break;
            st[counter][0] = mid;
            st[counter][1] = last;
            st[counter][2] = add;
            counter++;
        }
        int sum;
        for(int i = 0; i < counter; i++){
            sum = st[i][0]+st[i][1];
            if(st[i][0] == -1 || st[i][1] == -1){
                System.out.println("F");
                continue;
            }
            if(sum >= 80)System.out.println("A");
            else if(sum >= 65)System.out.println("B");
            else if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F");
        }
    } main {
        Scanner scanner = new Scanner(System.in);

        short[][] st = new short[50][3];
        short counter=0;
        short mid, last, add;
        while(true){
            mid = scanner.nextShort();
            last = scanner.nextShort();
            add = scanner.nextShort();
            if(mid == -1&&last == -1&&add == -1)break;
            st[counter][0] = mid;
            st[counter][1] = last;
            st[counter][2] = add;
            counter++;
        }
        int sum;
        for(int i = 0; i < counter; i++){
            sum = st[i][0]+st[i][1];
            if(st[i][0] == -1 || st[i][1] == -1){
                System.out.println("F");
                continue;
            }
            if(sum >= 80)System.out.println("A");
            else if(sum >= 65)System.out.println("B");
            else if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F");
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) short[][] st = new short[50][3]; st new short[50][3] 50 3 short counter=0; counter 0 short mid mid last last add; add while(true){
            mid = scanner.nextShort();
            last = scanner.nextShort();
            add = scanner.nextShort();
            if(mid == -1&&last == -1&&add == -1)break;
            st[counter][0] = mid;
            st[counter][1] = last;
            st[counter][2] = add;
            counter++;
        } true {
            mid = scanner.nextShort();
            last = scanner.nextShort();
            add = scanner.nextShort();
            if(mid == -1&&last == -1&&add == -1)break;
            st[counter][0] = mid;
            st[counter][1] = last;
            st[counter][2] = add;
            counter++;
        } mid = scanner.nextShort() mid scanner.nextShort() scanner.nextShort scanner last = scanner.nextShort() last scanner.nextShort() scanner.nextShort scanner add = scanner.nextShort() add scanner.nextShort() scanner.nextShort scanner if(mid == -1&&last == -1&&add == -1)break; mid == -1&&last == -1&&add == -1 mid == -1&&last == -1&&add == -1 mid == -1 mid -1 1 last == -1 last -1 1 add == -1 add -1 1 break; st[counter][0] = mid st[counter][0] st[counter] st counter 0 mid st[counter][1] = last st[counter][1] st[counter] st counter 1 last st[counter][2] = add st[counter][2] st[counter] st counter 2 add counter++ counter int sum; sum for(int i = 0; i < counter; i++){
            sum = st[i][0]+st[i][1];
            if(st[i][0] == -1 || st[i][1] == -1){
                System.out.println("F");
                continue;
            }
            if(sum >= 80)System.out.println("A");
            else if(sum >= 65)System.out.println("B");
            else if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F");
        } int i = 0; int i = 0; i 0 i < counter i counter i++ i++ i {
            sum = st[i][0]+st[i][1];
            if(st[i][0] == -1 || st[i][1] == -1){
                System.out.println("F");
                continue;
            }
            if(sum >= 80)System.out.println("A");
            else if(sum >= 65)System.out.println("B");
            else if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F");
        } {
            sum = st[i][0]+st[i][1];
            if(st[i][0] == -1 || st[i][1] == -1){
                System.out.println("F");
                continue;
            }
            if(sum >= 80)System.out.println("A");
            else if(sum >= 65)System.out.println("B");
            else if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F");
        } sum = st[i][0]+st[i][1] sum st[i][0]+st[i][1] st[i][0] st[i] st i 0 st[i][1] st[i] st i 1 if(st[i][0] == -1 || st[i][1] == -1){
                System.out.println("F");
                continue;
            } st[i][0] == -1 || st[i][1] == -1 st[i][0] == -1 st[i][0] st[i] st i 0 -1 1 st[i][1] == -1 st[i][1] st[i] st i 1 -1 1 {
                System.out.println("F");
                continue;
            } System.out.println("F") System.out.println System.out System System.out "F" continue; if(sum >= 80)System.out.println("A");
            else if(sum >= 65)System.out.println("B");
            else if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F"); sum >= 80 sum 80 System.out.println("A") System.out.println System.out System System.out "A" if(sum >= 65)System.out.println("B");
            else if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F"); sum >= 65 sum 65 System.out.println("B") System.out.println System.out System System.out "B" if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F"); sum >= 50 sum 50 System.out.println("C") System.out.println System.out System System.out "C" if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F"); sum >= 30 sum 30 {
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            } if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D"); st[i][2] >= 50 st[i][2] st[i] st i 2 50 System.out.println("C") System.out.println System.out System System.out "C" System.out.println("D") System.out.println System.out System System.out "D" System.out.println("F") System.out.println System.out System System.out "F" String[] args args
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        short[][] st = new short[50][3];
        short counter=0;
        short mid, last, add;
        while(true){
            mid = scanner.nextShort();
            last = scanner.nextShort();
            add = scanner.nextShort();
            if(mid == -1&&last == -1&&add == -1)break;
            st[counter][0] = mid;
            st[counter][1] = last;
            st[counter][2] = add;
            counter++;
        }
        int sum;
        for(int i = 0; i < counter; i++){
            sum = st[i][0]+st[i][1];
            if(st[i][0] == -1 || st[i][1] == -1){
                System.out.println("F");
                continue;
            }
            if(sum >= 80)System.out.println("A");
            else if(sum >= 65)System.out.println("B");
            else if(sum >= 50)System.out.println("C");
            else if(sum >= 30){
                if(st[i][2] >= 50)System.out.println("C");
                else System.out.println("D");
            }
            else System.out.println("F");
        }
    }
}

