import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String result;
		int total;
		while(true){
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if((m == -1) && (f == -1) && (r == -1)){
				break;
			}
			total = m + f;
			if ((m * f < 0)){
				result = "F";
			} else if (total >= 80){
				result = "A";
			} else if (total >= 65){
				result = "B";
			} else if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			}
			System.out.println(result);
		}
	}
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String result;
		int total;
		while(true){
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if((m == -1) && (f == -1) && (r == -1)){
				break;
			}
			total = m + f;
			if ((m * f < 0)){
				result = "F";
			} else if (total >= 80){
				result = "A";
			} else if (total >= 65){
				result = "B";
			} else if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			}
			System.out.println(result);
		}
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String result;
		int total;
		while(true){
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if((m == -1) && (f == -1) && (r == -1)){
				break;
			}
			total = m + f;
			if ((m * f < 0)){
				result = "F";
			} else if (total >= 80){
				result = "A";
			} else if (total >= 65){
				result = "B";
			} else if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			}
			System.out.println(result);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String result;
		int total;
		while(true){
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if((m == -1) && (f == -1) && (r == -1)){
				break;
			}
			total = m + f;
			if ((m * f < 0)){
				result = "F";
			} else if (total >= 80){
				result = "A";
			} else if (total >= 65){
				result = "B";
			} else if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			}
			System.out.println(result);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String result; result int total; total while(true){
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if((m == -1) && (f == -1) && (r == -1)){
				break;
			}
			total = m + f;
			if ((m * f < 0)){
				result = "F";
			} else if (total >= 80){
				result = "A";
			} else if (total >= 65){
				result = "B";
			} else if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			}
			System.out.println(result);
		} true {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if((m == -1) && (f == -1) && (r == -1)){
				break;
			}
			total = m + f;
			if ((m * f < 0)){
				result = "F";
			} else if (total >= 80){
				result = "A";
			} else if (total >= 65){
				result = "B";
			} else if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			}
			System.out.println(result);
		} int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc if((m == -1) && (f == -1) && (r == -1)){
				break;
			} (m == -1) && (f == -1) && (r == -1) (m == -1) && (f == -1) && (r == -1) (m == -1) m -1 1 (f == -1) f -1 1 (r == -1) r -1 1 {
				break;
			} break; total = m + f total m + f m f if ((m * f < 0)){
				result = "F";
			} else if (total >= 80){
				result = "A";
			} else if (total >= 65){
				result = "B";
			} else if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			} (m * f < 0) m * f m f 0 {
				result = "F";
			} result = "F" result "F" if (total >= 80){
				result = "A";
			} else if (total >= 65){
				result = "B";
			} else if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			} total >= 80 total 80 {
				result = "A";
			} result = "A" result "A" if (total >= 65){
				result = "B";
			} else if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			} total >= 65 total 65 {
				result = "B";
			} result = "B" result "B" if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			} total >= 50 total 50 {
				result = "C";
			} result = "C" result "C" if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			} total >= 30 total 30 {
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				} r >= 50 r 50 {
					result = "C";
				} result = "C" result "C" {
					result = "D";
				} result = "D" result "D" {
				result = "F";
			} result = "F" result "F" System.out.println(result) System.out.println System.out System System.out result String[] args args
import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String result;
		int total;
		while(true){
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if((m == -1) && (f == -1) && (r == -1)){
				break;
			}
			total = m + f;
			if ((m * f < 0)){
				result = "F";
			} else if (total >= 80){
				result = "A";
			} else if (total >= 65){
				result = "B";
			} else if (total >= 50){
				result = "C";
			} else if (total >= 30){
				if (r >= 50){
					result = "C";
				}
				else {
					result = "D";
				}
			} else {
				result = "F";
			}
			System.out.println(result);
		}
	}
}