import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int m,f,r;

		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m==-1 && f==-1 && r==-1) break;
			System.out.println(check(m,f,r));
		}

		scan.close();
	}

	static String check(int m,int f,int r) {
		int sum = m+f;
		if(m==-1 || f==-1) return "F";
		if(sum>=80) return"A";
		if(sum>=65 && sum<=80) return "B";
		if(sum>=50 && sum<=65 || r>=50) return "C";
		if(sum>=30 && sum<=50) return "D";
		return "F";
	}

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

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int m,f,r;

		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m==-1 && f==-1 && r==-1) break;
			System.out.println(check(m,f,r));
		}

		scan.close();
	}

	static String check(int m,int f,int r) {
		int sum = m+f;
		if(m==-1 || f==-1) return "F";
		if(sum>=80) return"A";
		if(sum>=65 && sum<=80) return "B";
		if(sum>=50 && sum<=65 || r>=50) return "C";
		if(sum>=30 && sum<=50) return "D";
		return "F";
	}

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

		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m==-1 && f==-1 && r==-1) break;
			System.out.println(check(m,f,r));
		}

		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int m,f,r;

		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m==-1 && f==-1 && r==-1) break;
			System.out.println(check(m,f,r));
		}

		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int m m f f r; r while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m==-1 && f==-1 && r==-1) break;
			System.out.println(check(m,f,r));
		} true {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m==-1 && f==-1 && r==-1) break;
			System.out.println(check(m,f,r));
		} 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; System.out.println(check(m,f,r)) System.out.println System.out System System.out check(m,f,r) check m f r scan.close() scan.close scan String[] args args static String check(int m,int f,int r) {
		int sum = m+f;
		if(m==-1 || f==-1) return "F";
		if(sum>=80) return"A";
		if(sum>=65 && sum<=80) return "B";
		if(sum>=50 && sum<=65 || r>=50) return "C";
		if(sum>=30 && sum<=50) return "D";
		return "F";
	} check {
		int sum = m+f;
		if(m==-1 || f==-1) return "F";
		if(sum>=80) return"A";
		if(sum>=65 && sum<=80) return "B";
		if(sum>=50 && sum<=65 || r>=50) return "C";
		if(sum>=30 && sum<=50) return "D";
		return "F";
	} int sum = m+f; sum m+f m f if(m==-1 || f==-1) return "F"; m==-1 || f==-1 m==-1 m -1 1 f==-1 f -1 1 return "F"; "F" if(sum>=80) return"A"; sum>=80 sum 80 return"A"; "A" if(sum>=65 && sum<=80) return "B"; sum>=65 && sum<=80 sum>=65 sum 65 sum<=80 sum 80 return "B"; "B" if(sum>=50 && sum<=65 || r>=50) return "C"; sum>=50 && sum<=65 || r>=50 sum>=50 && sum<=65 sum>=50 sum 50 sum<=65 sum 65 r>=50 r 50 return "C"; "C" if(sum>=30 && sum<=50) return "D"; sum>=30 && sum<=50 sum>=30 sum 30 sum<=50 sum 50 return "D"; "D" return "F"; "F" int m m int f f int r r public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int m,f,r;

		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m==-1 && f==-1 && r==-1) break;
			System.out.println(check(m,f,r));
		}

		scan.close();
	}

	static String check(int m,int f,int r) {
		int sum = m+f;
		if(m==-1 || f==-1) return "F";
		if(sum>=80) return"A";
		if(sum>=65 && sum<=80) return "B";
		if(sum>=50 && sum<=65 || r>=50) return "C";
		if(sum>=30 && sum<=50) return "D";
		return "F";
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int m,f,r;

		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m==-1 && f==-1 && r==-1) break;
			System.out.println(check(m,f,r));
		}

		scan.close();
	}

	static String check(int m,int f,int r) {
		int sum = m+f;
		if(m==-1 || f==-1) return "F";
		if(sum>=80) return"A";
		if(sum>=65 && sum<=80) return "B";
		if(sum>=50 && sum<=65 || r>=50) return "C";
		if(sum>=30 && sum<=50) return "D";
		return "F";
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int m,f,r;

		while(true) {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m==-1 && f==-1 && r==-1) break;
			System.out.println(check(m,f,r));
		}

		scan.close();
	}

	static String check(int m,int f,int r) {
		int sum = m+f;
		if(m==-1 || f==-1) return "F";
		if(sum>=80) return"A";
		if(sum>=65 && sum<=80) return "B";
		if(sum>=50 && sum<=65 || r>=50) return "C";
		if(sum>=30 && sum<=50) return "D";
		return "F";
	}

}
