import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		for(;;){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int sum;
			if(m == -1)
				sum = m;
			else if(f == -1)
				sum = f;
			else if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f;

			if(m == -1 && f == -1 && r == -1)
				break;
			else if(sum >= 80)
				System.out.println("A");
			else if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F");

			if(r == -1)
				continue;

		}
	}

} import java.util.Scanner; Scanner java.util class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		for(;;){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int sum;
			if(m == -1)
				sum = m;
			else if(f == -1)
				sum = f;
			else if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f;

			if(m == -1 && f == -1 && r == -1)
				break;
			else if(sum >= 80)
				System.out.println("A");
			else if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F");

			if(r == -1)
				continue;

		}
	}

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

		Scanner scan = new Scanner(System.in);

		for(;;){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int sum;
			if(m == -1)
				sum = m;
			else if(f == -1)
				sum = f;
			else if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f;

			if(m == -1 && f == -1 && r == -1)
				break;
			else if(sum >= 80)
				System.out.println("A");
			else if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F");

			if(r == -1)
				continue;

		}
	} main {

		Scanner scan = new Scanner(System.in);

		for(;;){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int sum;
			if(m == -1)
				sum = m;
			else if(f == -1)
				sum = f;
			else if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f;

			if(m == -1 && f == -1 && r == -1)
				break;
			else if(sum >= 80)
				System.out.println("A");
			else if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F");

			if(r == -1)
				continue;

		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) for(;;){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int sum;
			if(m == -1)
				sum = m;
			else if(f == -1)
				sum = f;
			else if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f;

			if(m == -1 && f == -1 && r == -1)
				break;
			else if(sum >= 80)
				System.out.println("A");
			else if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F");

			if(r == -1)
				continue;

		} ; {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int sum;
			if(m == -1)
				sum = m;
			else if(f == -1)
				sum = f;
			else if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f;

			if(m == -1 && f == -1 && r == -1)
				break;
			else if(sum >= 80)
				System.out.println("A");
			else if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F");

			if(r == -1)
				continue;

		} {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int sum;
			if(m == -1)
				sum = m;
			else if(f == -1)
				sum = f;
			else if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f;

			if(m == -1 && f == -1 && r == -1)
				break;
			else if(sum >= 80)
				System.out.println("A");
			else if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F");

			if(r == -1)
				continue;

		} int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int f = scan.nextInt(); f scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan int sum; sum if(m == -1)
				sum = m;
			else if(f == -1)
				sum = f;
			else if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f; m == -1 m -1 1 sum = m sum m if(f == -1)
				sum = f;
			else if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f; f == -1 f -1 1 sum = f sum f if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f; m == -1 && f == -1 m == -1 m -1 1 f == -1 f -1 1 sum = 0 sum 0 sum = m + f sum m + f m f if(m == -1 && f == -1 && r == -1)
				break;
			else if(sum >= 80)
				System.out.println("A");
			else if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F"); 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; if(sum >= 80)
				System.out.println("A");
			else if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F"); sum >= 80 sum 80 System.out.println("A") System.out.println System.out System System.out "A" if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F"); sum >= 65 && sum < 80 sum >= 65 sum 65 sum < 80 sum 80 System.out.println("B") System.out.println System.out System System.out "B" if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F"); (sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50) (sum >= 50 && sum < 65) sum >= 50 sum 50 sum < 65 sum 65 (sum >= 30 && sum < 50 && r >= 50) sum >= 30 && sum < 50 && r >= 50 sum >= 30 sum 30 sum < 50 sum 50 r >= 50 r 50 System.out.println("C") System.out.println System.out System System.out "C" if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F"); sum >= 30 && sum < 50 sum >= 30 sum 30 sum < 50 sum 50 System.out.println("D") System.out.println System.out System System.out "D" if(sum < 30)
				System.out.println("F"); sum < 30 sum 30 System.out.println("F") System.out.println System.out System System.out "F" if(r == -1)
				continue; r == -1 r -1 1 continue; String[] args args
import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		for(;;){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int sum;
			if(m == -1)
				sum = m;
			else if(f == -1)
				sum = f;
			else if(m == -1 && f == -1)
				sum = 0;
			else
				sum = m + f;

			if(m == -1 && f == -1 && r == -1)
				break;
			else if(sum >= 80)
				System.out.println("A");
			else if(sum >= 65 && sum < 80)
				System.out.println("B");
			else if((sum >= 50 && sum < 65) || (sum >= 30 && sum < 50 && r >= 50))
				System.out.println("C");
			else if(sum >= 30 && sum < 50)
				System.out.println("D");
			else if(sum < 30)
				System.out.println("F");

			if(r == -1)
				continue;

		}
	}

}