import java.util.Scanner;
public class Main{
	public static void main(String[] arags){
		Scanner scan = new Scanner(System.in);
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int check = m+f;

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

			if(m==-1||f==-1){
				System.out.println("F");
			}else if(check>=80){
				System.out.println("A");
			}else if(check>=65&&check<80){
				System.out.println("B");
			}else if(check>=50&&check<65){
				System.out.println("C");
			}else if(check>=30&&check<50){
				if(r>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else if(check<30){
				System.out.println("F");
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] arags){
		Scanner scan = new Scanner(System.in);
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int check = m+f;

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

			if(m==-1||f==-1){
				System.out.println("F");
			}else if(check>=80){
				System.out.println("A");
			}else if(check>=65&&check<80){
				System.out.println("B");
			}else if(check>=50&&check<65){
				System.out.println("C");
			}else if(check>=30&&check<50){
				if(r>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else if(check<30){
				System.out.println("F");
			}
		}
	}
} Main public static void main(String[] arags){
		Scanner scan = new Scanner(System.in);
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int check = m+f;

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

			if(m==-1||f==-1){
				System.out.println("F");
			}else if(check>=80){
				System.out.println("A");
			}else if(check>=65&&check<80){
				System.out.println("B");
			}else if(check>=50&&check<65){
				System.out.println("C");
			}else if(check>=30&&check<50){
				if(r>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else if(check<30){
				System.out.println("F");
			}
		}
	} main {
		Scanner scan = new Scanner(System.in);
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int check = m+f;

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

			if(m==-1||f==-1){
				System.out.println("F");
			}else if(check>=80){
				System.out.println("A");
			}else if(check>=65&&check<80){
				System.out.println("B");
			}else if(check>=50&&check<65){
				System.out.println("C");
			}else if(check>=30&&check<50){
				if(r>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else if(check<30){
				System.out.println("F");
			}
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int check = m+f;

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

			if(m==-1||f==-1){
				System.out.println("F");
			}else if(check>=80){
				System.out.println("A");
			}else if(check>=65&&check<80){
				System.out.println("B");
			}else if(check>=50&&check<65){
				System.out.println("C");
			}else if(check>=30&&check<50){
				if(r>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else if(check<30){
				System.out.println("F");
			}
		} true {
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int check = m+f;

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

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

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

			if(m==-1||f==-1){
				System.out.println("F");
			}else if(check>=80){
				System.out.println("A");
			}else if(check>=65&&check<80){
				System.out.println("B");
			}else if(check>=50&&check<65){
				System.out.println("C");
			}else if(check>=30&&check<50){
				if(r>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else if(check<30){
				System.out.println("F");
			}
		}
	}
} public class Main{
	public static void main(String[] arags){
		Scanner scan = new Scanner(System.in);
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int check = m+f;

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

			if(m==-1||f==-1){
				System.out.println("F");
			}else if(check>=80){
				System.out.println("A");
			}else if(check>=65&&check<80){
				System.out.println("B");
			}else if(check>=50&&check<65){
				System.out.println("C");
			}else if(check>=30&&check<50){
				if(r>=50){
					System.out.println("C");
				}else{
					System.out.println("D");
				}
			}else if(check<30){
				System.out.println("F");
			}
		}
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] arags){
		Scanner scan = new Scanner(System.in);
		while(true){
			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();
			int check = m+f;

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

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