import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ?????°?????\???
		while (true) {

			int mid = sc.nextInt();
			int fnl = sc.nextInt();
			int ret = sc.nextInt();

			if(mid == -1 && fnl == -1 && ret == -1)
				break;

			if( mid == -1 || fnl == -1){

				System.out.println("F");

			} else if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			}
		}
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ?????°?????\???
		while (true) {

			int mid = sc.nextInt();
			int fnl = sc.nextInt();
			int ret = sc.nextInt();

			if(mid == -1 && fnl == -1 && ret == -1)
				break;

			if( mid == -1 || fnl == -1){

				System.out.println("F");

			} else if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			}
		}
		sc.close();
	}
} Main public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ?????°?????\???
		while (true) {

			int mid = sc.nextInt();
			int fnl = sc.nextInt();
			int ret = sc.nextInt();

			if(mid == -1 && fnl == -1 && ret == -1)
				break;

			if( mid == -1 || fnl == -1){

				System.out.println("F");

			} else if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			}
		}
		sc.close();
	} main {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ?????°?????\???
		while (true) {

			int mid = sc.nextInt();
			int fnl = sc.nextInt();
			int ret = sc.nextInt();

			if(mid == -1 && fnl == -1 && ret == -1)
				break;

			if( mid == -1 || fnl == -1){

				System.out.println("F");

			} else if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			}
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (true) {

			int mid = sc.nextInt();
			int fnl = sc.nextInt();
			int ret = sc.nextInt();

			if(mid == -1 && fnl == -1 && ret == -1)
				break;

			if( mid == -1 || fnl == -1){

				System.out.println("F");

			} else if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			}
		} true {

			int mid = sc.nextInt();
			int fnl = sc.nextInt();
			int ret = sc.nextInt();

			if(mid == -1 && fnl == -1 && ret == -1)
				break;

			if( mid == -1 || fnl == -1){

				System.out.println("F");

			} else if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			}
		} int mid = sc.nextInt(); mid sc.nextInt() sc.nextInt sc int fnl = sc.nextInt(); fnl sc.nextInt() sc.nextInt sc int ret = sc.nextInt(); ret sc.nextInt() sc.nextInt sc if(mid == -1 && fnl == -1 && ret == -1)
				break; mid == -1 && fnl == -1 && ret == -1 mid == -1 && fnl == -1 && ret == -1 mid == -1 mid -1 1 fnl == -1 fnl -1 1 ret == -1 ret -1 1 break; if( mid == -1 || fnl == -1){

				System.out.println("F");

			} else if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			} mid == -1 || fnl == -1 mid == -1 mid -1 1 fnl == -1 fnl -1 1 {

				System.out.println("F");

			} System.out.println("F") System.out.println System.out System System.out "F" if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			} mid + fnl >= 80 mid + fnl mid fnl 80 {

				System.out.println("A");

			} System.out.println("A") System.out.println System.out System System.out "A" if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			} mid + fnl < 80 && mid + fnl >= 65 mid + fnl < 80 mid + fnl mid fnl 80 mid + fnl >= 65 mid + fnl mid fnl 65 {

				System.out.println("B");

			} System.out.println("B") System.out.println System.out System System.out "B" if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			} mid + fnl < 65 && mid + fnl >= 50 mid + fnl < 65 mid + fnl mid fnl 65 mid + fnl >= 50 mid + fnl mid fnl 50 {

				System.out.println("C");

			} System.out.println("C") System.out.println System.out System System.out "C" if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			} mid + fnl < 50 && mid + fnl >= 30 mid + fnl < 50 mid + fnl mid fnl 50 mid + fnl >= 30 mid + fnl mid fnl 30 {

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				} ret >= 50 ret 50 {

					System.out.println("C");

				} System.out.println("C") System.out.println System.out System System.out "C" {

				System.out.println("D");

				} System.out.println("D") System.out.println System.out System System.out "D" if (mid + fnl < 30){

				System.out.println("F");

			} mid + fnl < 30 mid + fnl mid fnl 30 {

				System.out.println("F");

			} System.out.println("F") System.out.println System.out System System.out "F" sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ?????°?????\???
		while (true) {

			int mid = sc.nextInt();
			int fnl = sc.nextInt();
			int ret = sc.nextInt();

			if(mid == -1 && fnl == -1 && ret == -1)
				break;

			if( mid == -1 || fnl == -1){

				System.out.println("F");

			} else if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			}
		}
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ?????°?????\???
		while (true) {

			int mid = sc.nextInt();
			int fnl = sc.nextInt();
			int ret = sc.nextInt();

			if(mid == -1 && fnl == -1 && ret == -1)
				break;

			if( mid == -1 || fnl == -1){

				System.out.println("F");

			} else if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			}
		}
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		// ?????????????????\????????????
		Scanner sc = new Scanner(System.in);

		// ?????°?????\???
		while (true) {

			int mid = sc.nextInt();
			int fnl = sc.nextInt();
			int ret = sc.nextInt();

			if(mid == -1 && fnl == -1 && ret == -1)
				break;

			if( mid == -1 || fnl == -1){

				System.out.println("F");

			} else if(mid + fnl >= 80){

				System.out.println("A");

			} else if (mid + fnl < 80 && mid + fnl >= 65){

				System.out.println("B");

			} else if (mid + fnl < 65 && mid + fnl >= 50){

				System.out.println("C");

			} else if (mid + fnl < 50 && mid + fnl >= 30){

				if(ret >= 50){

					System.out.println("C");

				} else {

				System.out.println("D");

				}

			} else if (mid + fnl < 30){

				System.out.println("F");

			}
		}
		sc.close();
	}
}