import java.util.Scanner;
class Main {
	private static String[] ten = new String[100];
	public void kami() {
		Scanner sc = new Scanner(System.in);
		int x = 0;
		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();
		while(m != -1 || f != -1 || r != -1){
			if(m <= 50 && f <= 50){
				if(m == -1 || f == -1){
					ten[x] = "F";
				}else if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				}
			}
			x++;
			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		for(int i = 0; i <= x-1; i++){
			System.out.println(ten[i]);
		}
	}

	public static void main(String[] args) {

		new Main().kami();
	}

} import java.util.Scanner; Scanner java.util class Main {
	private static String[] ten = new String[100];
	public void kami() {
		Scanner sc = new Scanner(System.in);
		int x = 0;
		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();
		while(m != -1 || f != -1 || r != -1){
			if(m <= 50 && f <= 50){
				if(m == -1 || f == -1){
					ten[x] = "F";
				}else if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				}
			}
			x++;
			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		for(int i = 0; i <= x-1; i++){
			System.out.println(ten[i]);
		}
	}

	public static void main(String[] args) {

		new Main().kami();
	}

} Main private static String[] ten = new String[100]; ten new String[100] 100 public void kami() {
		Scanner sc = new Scanner(System.in);
		int x = 0;
		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();
		while(m != -1 || f != -1 || r != -1){
			if(m <= 50 && f <= 50){
				if(m == -1 || f == -1){
					ten[x] = "F";
				}else if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				}
			}
			x++;
			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		for(int i = 0; i <= x-1; i++){
			System.out.println(ten[i]);
		}
	} kami {
		Scanner sc = new Scanner(System.in);
		int x = 0;
		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();
		while(m != -1 || f != -1 || r != -1){
			if(m <= 50 && f <= 50){
				if(m == -1 || f == -1){
					ten[x] = "F";
				}else if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				}
			}
			x++;
			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		for(int i = 0; i <= x-1; i++){
			System.out.println(ten[i]);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x = 0; x 0 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 while(m != -1 || f != -1 || r != -1){
			if(m <= 50 && f <= 50){
				if(m == -1 || f == -1){
					ten[x] = "F";
				}else if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				}
			}
			x++;
			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		} 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 {
			if(m <= 50 && f <= 50){
				if(m == -1 || f == -1){
					ten[x] = "F";
				}else if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				}
			}
			x++;
			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		} if(m <= 50 && f <= 50){
				if(m == -1 || f == -1){
					ten[x] = "F";
				}else if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				}
			} m <= 50 && f <= 50 m <= 50 m 50 f <= 50 f 50 {
				if(m == -1 || f == -1){
					ten[x] = "F";
				}else if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				}
			} if(m == -1 || f == -1){
					ten[x] = "F";
				}else if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
					ten[x] = "F";
				} ten[x] = "F" ten[x] ten x "F" if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				} m + f >= 80 m + f m f 80 {
					ten[x] = "A";
				} ten[x] = "A" ten[x] ten x "A" if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				} m + f >= 65 m + f m f 65 {
					ten[x] = "B";
				} ten[x] = "B" ten[x] ten x "B" if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				} m + f >= 50 || (m + f >= 30 && r >= 50) m + f >= 50 m + f m f 50 (m + f >= 30 && r >= 50) m + f >= 30 m + f m f 30 r >= 50 r 50 {
					ten[x] = "C";
				} ten[x] = "C" ten[x] ten x "C" if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				} m + f >= 30 m + f m f 30 {
					ten[x] = "D";
				} ten[x] = "D" ten[x] ten x "D" if(m + f < 30){
					ten[x] = "F";
				} m + f < 30 m + f m f 30 {
					ten[x] = "F";
				} ten[x] = "F" ten[x] ten x "F" x++ x m = sc.nextInt() m sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc for(int i = 0; i <= x-1; i++){
			System.out.println(ten[i]);
		} int i = 0; int i = 0; i 0 i <= x-1 i x-1 x 1 i++ i++ i {
			System.out.println(ten[i]);
		} {
			System.out.println(ten[i]);
		} System.out.println(ten[i]) System.out.println System.out System System.out ten[i] ten i public static void main(String[] args) {

		new Main().kami();
	} main {

		new Main().kami();
	} new Main().kami() new Main().kami new Main() String[] args args
import java.util.Scanner;
class Main {
	private static String[] ten = new String[100];
	public void kami() {
		Scanner sc = new Scanner(System.in);
		int x = 0;
		int m = sc.nextInt();
		int f = sc.nextInt();
		int r = sc.nextInt();
		while(m != -1 || f != -1 || r != -1){
			if(m <= 50 && f <= 50){
				if(m == -1 || f == -1){
					ten[x] = "F";
				}else if(m + f >= 80){
					ten[x] = "A";
				}else if(m + f >= 65){
					ten[x] = "B";
				}else if(m + f >= 50 || (m + f >= 30 && r >= 50)){
					ten[x] = "C";
				}else if(m + f >= 30){
					ten[x] = "D";
				}else if(m + f < 30){
					ten[x] = "F";
				}
			}
			x++;
			m = sc.nextInt();
			f = sc.nextInt();
			r = sc.nextInt();
		}
		for(int i = 0; i <= x-1; i++){
			System.out.println(ten[i]);
		}
	}

	public static void main(String[] args) {

		new Main().kami();
	}

}