import java.util.Scanner;

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

	int m, f, r, i = 0;
	int data[] = new int[100];
	while(true) {
		m = scan.nextInt();
		f = scan.nextInt();
		r = scan.nextInt();
		if(m == -1 && f == -1 && r == -1) break;
		if(m == -1 || f == -1) data[i] = 5;
		else if(m+f >= 80) data[i] = 1;
		else if(m+f >= 65) data[i] = 2;
		else if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5;
		i++;
	}
	for(int count = 0; count < i; count++) {
		if(data[count] == 1) System.out.println("A");
		else if(data[count] == 2) System.out.println("B");
		else if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F");
	}

	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int m, f, r, i = 0;
	int data[] = new int[100];
	while(true) {
		m = scan.nextInt();
		f = scan.nextInt();
		r = scan.nextInt();
		if(m == -1 && f == -1 && r == -1) break;
		if(m == -1 || f == -1) data[i] = 5;
		else if(m+f >= 80) data[i] = 1;
		else if(m+f >= 65) data[i] = 2;
		else if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5;
		i++;
	}
	for(int count = 0; count < i; count++) {
		if(data[count] == 1) System.out.println("A");
		else if(data[count] == 2) System.out.println("B");
		else if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F");
	}

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

	int m, f, r, i = 0;
	int data[] = new int[100];
	while(true) {
		m = scan.nextInt();
		f = scan.nextInt();
		r = scan.nextInt();
		if(m == -1 && f == -1 && r == -1) break;
		if(m == -1 || f == -1) data[i] = 5;
		else if(m+f >= 80) data[i] = 1;
		else if(m+f >= 65) data[i] = 2;
		else if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5;
		i++;
	}
	for(int count = 0; count < i; count++) {
		if(data[count] == 1) System.out.println("A");
		else if(data[count] == 2) System.out.println("B");
		else if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F");
	}

	} main {
	Scanner scan = new Scanner(System.in);

	int m, f, r, i = 0;
	int data[] = new int[100];
	while(true) {
		m = scan.nextInt();
		f = scan.nextInt();
		r = scan.nextInt();
		if(m == -1 && f == -1 && r == -1) break;
		if(m == -1 || f == -1) data[i] = 5;
		else if(m+f >= 80) data[i] = 1;
		else if(m+f >= 65) data[i] = 2;
		else if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5;
		i++;
	}
	for(int count = 0; count < i; count++) {
		if(data[count] == 1) System.out.println("A");
		else if(data[count] == 2) System.out.println("B");
		else if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F");
	}

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int m m f f r r i = 0; i 0 int data[] = new int[100]; data new int[100] 100 while(true) {
		m = scan.nextInt();
		f = scan.nextInt();
		r = scan.nextInt();
		if(m == -1 && f == -1 && r == -1) break;
		if(m == -1 || f == -1) data[i] = 5;
		else if(m+f >= 80) data[i] = 1;
		else if(m+f >= 65) data[i] = 2;
		else if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5;
		i++;
	} true {
		m = scan.nextInt();
		f = scan.nextInt();
		r = scan.nextInt();
		if(m == -1 && f == -1 && r == -1) break;
		if(m == -1 || f == -1) data[i] = 5;
		else if(m+f >= 80) data[i] = 1;
		else if(m+f >= 65) data[i] = 2;
		else if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5;
		i++;
	} m = scan.nextInt() m scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan 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; if(m == -1 || f == -1) data[i] = 5;
		else if(m+f >= 80) data[i] = 1;
		else if(m+f >= 65) data[i] = 2;
		else if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5; m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 data[i] = 5 data[i] data i 5 if(m+f >= 80) data[i] = 1;
		else if(m+f >= 65) data[i] = 2;
		else if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5; m+f >= 80 m+f m f 80 data[i] = 1 data[i] data i 1 if(m+f >= 65) data[i] = 2;
		else if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5; m+f >= 65 m+f m f 65 data[i] = 2 data[i] data i 2 if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5; m+f >= 50 m+f m f 50 data[i] = 3 data[i] data i 3 if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5; m+f >= 30 m+f m f 30 {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		} if(r >= 50) data[i] = 3;
			else data[i] = 4; r >= 50 r 50 data[i] = 3 data[i] data i 3 data[i] = 4 data[i] data i 4 data[i] = 5 data[i] data i 5 i++ i for(int count = 0; count < i; count++) {
		if(data[count] == 1) System.out.println("A");
		else if(data[count] == 2) System.out.println("B");
		else if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F");
	} int count = 0; int count = 0; count 0 count < i count i count++ count++ count {
		if(data[count] == 1) System.out.println("A");
		else if(data[count] == 2) System.out.println("B");
		else if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F");
	} {
		if(data[count] == 1) System.out.println("A");
		else if(data[count] == 2) System.out.println("B");
		else if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F");
	} if(data[count] == 1) System.out.println("A");
		else if(data[count] == 2) System.out.println("B");
		else if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F"); data[count] == 1 data[count] data count 1 System.out.println("A") System.out.println System.out System System.out "A" if(data[count] == 2) System.out.println("B");
		else if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F"); data[count] == 2 data[count] data count 2 System.out.println("B") System.out.println System.out System System.out "B" if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F"); data[count] == 3 data[count] data count 3 System.out.println("C") System.out.println System.out System System.out "C" if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F"); data[count] == 4 data[count] data count 4 System.out.println("D") System.out.println System.out System System.out "D" if(data[count] == 5) System.out.println("F"); data[count] == 5 data[count] data count 5 System.out.println("F") System.out.println System.out System System.out "F" String[] args args
import java.util.Scanner;

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

	int m, f, r, i = 0;
	int data[] = new int[100];
	while(true) {
		m = scan.nextInt();
		f = scan.nextInt();
		r = scan.nextInt();
		if(m == -1 && f == -1 && r == -1) break;
		if(m == -1 || f == -1) data[i] = 5;
		else if(m+f >= 80) data[i] = 1;
		else if(m+f >= 65) data[i] = 2;
		else if(m+f >= 50) data[i] = 3;
		else if(m+f >= 30) {
			if(r >= 50) data[i] = 3;
			else data[i] = 4;
		}
		else data[i] = 5;
		i++;
	}
	for(int count = 0; count < i; count++) {
		if(data[count] == 1) System.out.println("A");
		else if(data[count] == 2) System.out.println("B");
		else if(data[count] == 3) System.out.println("C");
		else if(data[count] == 4) System.out.println("D");
		else if(data[count] == 5) System.out.println("F");
	}

	}
}