import java.io.IOException;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws IOException{

		Scanner sc = new Scanner(System.in);
		String result = "";
		int score = 0;

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) {
				break;
			}

			score = m + f;

			if(m==-1 || f==-1) {
				result = "F";
			}else if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			}

			System.out.println(result);
		}

		sc.close();
	}
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws IOException{

		Scanner sc = new Scanner(System.in);
		String result = "";
		int score = 0;

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) {
				break;
			}

			score = m + f;

			if(m==-1 || f==-1) {
				result = "F";
			}else if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			}

			System.out.println(result);
		}

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

		Scanner sc = new Scanner(System.in);
		String result = "";
		int score = 0;

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) {
				break;
			}

			score = m + f;

			if(m==-1 || f==-1) {
				result = "F";
			}else if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			}

			System.out.println(result);
		}

		sc.close();
	} main {

		Scanner sc = new Scanner(System.in);
		String result = "";
		int score = 0;

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) {
				break;
			}

			score = m + f;

			if(m==-1 || f==-1) {
				result = "F";
			}else if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			}

			System.out.println(result);
		}

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String result = ""; result "" int score = 0; score 0 while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) {
				break;
			}

			score = m + f;

			if(m==-1 || f==-1) {
				result = "F";
			}else if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			}

			System.out.println(result);
		} true {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) {
				break;
			}

			score = m + f;

			if(m==-1 || f==-1) {
				result = "F";
			}else if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			}

			System.out.println(result);
		} 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 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;
			} break; score = m + f score m + f m f if(m==-1 || f==-1) {
				result = "F";
			}else if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			} m==-1 || f==-1 m==-1 m -1 1 f==-1 f -1 1 {
				result = "F";
			} result = "F" result "F" if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			} score >= 80 score 80 {
				result = "A";
			} result = "A" result "A" if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			} score >= 65 score 65 {
				result = "B";
			} result = "B" result "B" if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			} score >= 50 score 50 {
				result = "C";
			} result = "C" result "C" if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			} score >= 30 score 30 {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			} if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				} r==-1 || r<50 r==-1 r -1 1 r<50 r 50 {
					result = "D";
				} result = "D" result "D" if(r>=50) {
					result = "C";
				} r>=50 r 50 {
					result = "C";
				} result = "C" result "C" {
				result = "F";
			} result = "F" result "F" System.out.println(result) System.out.println System.out System System.out result sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) throws IOException{

		Scanner sc = new Scanner(System.in);
		String result = "";
		int score = 0;

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) {
				break;
			}

			score = m + f;

			if(m==-1 || f==-1) {
				result = "F";
			}else if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			}

			System.out.println(result);
		}

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

		Scanner sc = new Scanner(System.in);
		String result = "";
		int score = 0;

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) {
				break;
			}

			score = m + f;

			if(m==-1 || f==-1) {
				result = "F";
			}else if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			}

			System.out.println(result);
		}

		sc.close();
	}
} Main
import java.io.IOException;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws IOException{

		Scanner sc = new Scanner(System.in);
		String result = "";
		int score = 0;

		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();

			if(m == -1 && f == -1 && r == -1) {
				break;
			}

			score = m + f;

			if(m==-1 || f==-1) {
				result = "F";
			}else if(score >= 80) {
				result = "A";
			}else if(score >= 65) {
				result = "B";
			}else if(score >= 50) {
				result = "C";
			}else if(score >= 30) {
				if(r==-1 || r<50) {
					result = "D";
				}else if(r>=50) {
					result = "C";
				}
			}else {
				result = "F";
			}

			System.out.println(result);
		}

		sc.close();
	}
}
