import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<int[]> mfrs = new ArrayList<>();

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) break;

			int[] mfr = new int[] {m, f, r};
			mfrs.add(mfr);
		}
		sc.close();

		for (int[] mfr : mfrs) {
			char result;

			int m = mfr[0];
			int f = mfr[1];
			int r = mfr[2];

			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			}
			System.out.println(result);
		}

	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<int[]> mfrs = new ArrayList<>();

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) break;

			int[] mfr = new int[] {m, f, r};
			mfrs.add(mfr);
		}
		sc.close();

		for (int[] mfr : mfrs) {
			char result;

			int m = mfr[0];
			int f = mfr[1];
			int r = mfr[2];

			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			}
			System.out.println(result);
		}

	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<int[]> mfrs = new ArrayList<>();

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) break;

			int[] mfr = new int[] {m, f, r};
			mfrs.add(mfr);
		}
		sc.close();

		for (int[] mfr : mfrs) {
			char result;

			int m = mfr[0];
			int f = mfr[1];
			int r = mfr[2];

			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			}
			System.out.println(result);
		}

	} main {

		Scanner sc = new Scanner(System.in);

		List<int[]> mfrs = new ArrayList<>();

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) break;

			int[] mfr = new int[] {m, f, r};
			mfrs.add(mfr);
		}
		sc.close();

		for (int[] mfr : mfrs) {
			char result;

			int m = mfr[0];
			int f = mfr[1];
			int r = mfr[2];

			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			}
			System.out.println(result);
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<int[]> mfrs = new ArrayList<>(); mfrs new ArrayList<>() while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) break;

			int[] mfr = new int[] {m, f, r};
			mfrs.add(mfr);
		} true {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) break;

			int[] mfr = new int[] {m, f, r};
			mfrs.add(mfr);
		} 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; int[] mfr = new int[] {m, f, r}; mfr new int[] {m, f, r} mfrs.add(mfr) mfrs.add mfrs mfr sc.close() sc.close sc for (int[] mfr : mfrs) {
			char result;

			int m = mfr[0];
			int f = mfr[1];
			int r = mfr[2];

			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			}
			System.out.println(result);
		} int[] mfr mfrs {
			char result;

			int m = mfr[0];
			int f = mfr[1];
			int r = mfr[2];

			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			}
			System.out.println(result);
		} {
			char result;

			int m = mfr[0];
			int f = mfr[1];
			int r = mfr[2];

			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			}
			System.out.println(result);
		} char result; result int m = mfr[0]; m mfr[0] mfr 0 int f = mfr[1]; f mfr[1] mfr 1 int r = mfr[2]; r mfr[2] mfr 2 if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
				result = 'F';
			} result = 'F' result 'F' if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			} m + f >= 80 m + f m f 80 {
				result = 'A';
			} result = 'A' result 'A' if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			} m + f >= 65 m + f m f 65 {
				result = 'B';
			} result = 'B' result 'B' if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			} m + f >= 50 m + f m f 50 {
				result = 'C';
			} result = 'C' result 'C' if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			} m + f >= 30 m + f m f 30 {
				result = 'D';
				if(r >= 50) result = 'C';
			} result = 'D' result 'D' if(r >= 50) result = 'C'; r >= 50 r 50 result = 'C' result 'C' {
				result = 'F';
			} result = 'F' result 'F' System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<int[]> mfrs = new ArrayList<>();

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) break;

			int[] mfr = new int[] {m, f, r};
			mfrs.add(mfr);
		}
		sc.close();

		for (int[] mfr : mfrs) {
			char result;

			int m = mfr[0];
			int f = mfr[1];
			int r = mfr[2];

			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			}
			System.out.println(result);
		}

	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<int[]> mfrs = new ArrayList<>();

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) break;

			int[] mfr = new int[] {m, f, r};
			mfrs.add(mfr);
		}
		sc.close();

		for (int[] mfr : mfrs) {
			char result;

			int m = mfr[0];
			int f = mfr[1];
			int r = mfr[2];

			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			}
			System.out.println(result);
		}

	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		List<int[]> mfrs = new ArrayList<>();

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) break;

			int[] mfr = new int[] {m, f, r};
			mfrs.add(mfr);
		}
		sc.close();

		for (int[] mfr : mfrs) {
			char result;

			int m = mfr[0];
			int f = mfr[1];
			int r = mfr[2];

			if (m == -1 || f == -1) {
				result = 'F';
			} else if (m + f >= 80) {
				result = 'A';
			} else if (m + f >= 65) {
				result = 'B';
			} else if (m + f >= 50) {
				result = 'C';
			} else if (m + f >= 30) {
				result = 'D';
				if(r >= 50) result = 'C';
			} else {
				result = 'F';
			}
			System.out.println(result);
		}

	}
}