import java.util.Scanner;

//20180509
//03

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

		while (scanner.hasNextLine()) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();

			int m_f = m + f;

			if(m + f + r == -3) {
				break;
			} else if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			}
		}
		scanner.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);

		while (scanner.hasNextLine()) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();

			int m_f = m + f;

			if(m + f + r == -3) {
				break;
			} else if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			}
		}
		scanner.close();
    }
} Main public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);

		while (scanner.hasNextLine()) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();

			int m_f = m + f;

			if(m + f + r == -3) {
				break;
			} else if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			}
		}
		scanner.close();
    } main {
		Scanner scanner = new Scanner(System.in);

		while (scanner.hasNextLine()) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();

			int m_f = m + f;

			if(m + f + r == -3) {
				break;
			} else if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			}
		}
		scanner.close();
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) while (scanner.hasNextLine()) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();

			int m_f = m + f;

			if(m + f + r == -3) {
				break;
			} else if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			}
		} scanner.hasNextLine() scanner.hasNextLine scanner {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();

			int m_f = m + f;

			if(m + f + r == -3) {
				break;
			} else if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			}
		} int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int f = scanner.nextInt(); f scanner.nextInt() scanner.nextInt scanner int r = scanner.nextInt(); r scanner.nextInt() scanner.nextInt scanner int m_f = m + f; m_f m + f m f if(m + f + r == -3) {
				break;
			} else if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			} m + f + r == -3 m + f + r m + f + r m f r -3 3 {
				break;
			} break; if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			} m_f >= 80 m_f 80 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			} m_f >= 65 && m_f < 80 m_f >= 65 m_f 65 m_f < 80 m_f 80 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			} m_f >= 50 && m_f < 65 m_f >= 50 m_f 50 m_f < 65 m_f 65 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			} m_f >= 30 && m_f < 50 && r >= 50 m_f >= 30 && m_f < 50 && r >= 50 m_f >= 30 m_f 30 m_f < 50 m_f 50 r >= 50 r 50 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			} m_f >= 30 && m_f < 50 m_f >= 30 m_f 30 m_f < 50 m_f 50 {
				System.out.println("D");
			} System.out.println("D") System.out.println System.out System System.out "D" if(m_f < 30) {
				System.out.println("F");
			} m_f < 30 m_f 30 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" scanner.close() scanner.close scanner String[] args args public class Main {
    public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);

		while (scanner.hasNextLine()) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();

			int m_f = m + f;

			if(m + f + r == -3) {
				break;
			} else if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			}
		}
		scanner.close();
    }
} public class Main {
    public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);

		while (scanner.hasNextLine()) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();

			int m_f = m + f;

			if(m + f + r == -3) {
				break;
			} else if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			}
		}
		scanner.close();
    }
} Main
import java.util.Scanner;

//20180509
//03

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

		while (scanner.hasNextLine()) {
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();

			int m_f = m + f;

			if(m + f + r == -3) {
				break;
			} else if(m == -1 || f == -1) {
				System.out.println("F");
			} else if(m_f >= 80) {
				System.out.println("A");
			} else if(m_f >= 65 && m_f < 80) {
				System.out.println("B");
			} else if(m_f >= 50 && m_f < 65) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50 && r >= 50) {
				System.out.println("C");
			} else if(m_f >= 30 && m_f < 50) {
				System.out.println("D");
			} else if(m_f < 30) {
				System.out.println("F");
			}
		}
		scanner.close();
    }
}
