import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int m = 0;
		int f = 0;
		int r = 0;
		String record ="";

		Scanner sc= new Scanner(System.in);

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

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

			if ( m == -1 || f == -1) {
				record ="F";
			} else if( ( m + f ) >= 80 ) {
				record ="A";
			} else if( ( m + f ) >= 65 ) {
				record ="B";
			} else if( ( m + f ) >= 50 ) {
				record ="C";
			} else if( ( m + f ) >= 30 ) {
				record ="D";
				if( r >= 50 ) {
					record ="C";
				}
			} else {
				record ="F";
			}
			System.out.println( record );
		}
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		int m = 0;
		int f = 0;
		int r = 0;
		String record ="";

		Scanner sc= new Scanner(System.in);

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

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

			if ( m == -1 || f == -1) {
				record ="F";
			} else if( ( m + f ) >= 80 ) {
				record ="A";
			} else if( ( m + f ) >= 65 ) {
				record ="B";
			} else if( ( m + f ) >= 50 ) {
				record ="C";
			} else if( ( m + f ) >= 30 ) {
				record ="D";
				if( r >= 50 ) {
					record ="C";
				}
			} else {
				record ="F";
			}
			System.out.println( record );
		}
		sc.close();
	}
} Main public static void main(String[] args) {

		int m = 0;
		int f = 0;
		int r = 0;
		String record ="";

		Scanner sc= new Scanner(System.in);

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

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

			if ( m == -1 || f == -1) {
				record ="F";
			} else if( ( m + f ) >= 80 ) {
				record ="A";
			} else if( ( m + f ) >= 65 ) {
				record ="B";
			} else if( ( m + f ) >= 50 ) {
				record ="C";
			} else if( ( m + f ) >= 30 ) {
				record ="D";
				if( r >= 50 ) {
					record ="C";
				}
			} else {
				record ="F";
			}
			System.out.println( record );
		}
		sc.close();
	} main {

		int m = 0;
		int f = 0;
		int r = 0;
		String record ="";

		Scanner sc= new Scanner(System.in);

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

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

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

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

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

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

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

	public static void main(String[] args) {

		int m = 0;
		int f = 0;
		int r = 0;
		String record ="";

		Scanner sc= new Scanner(System.in);

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

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

			if ( m == -1 || f == -1) {
				record ="F";
			} else if( ( m + f ) >= 80 ) {
				record ="A";
			} else if( ( m + f ) >= 65 ) {
				record ="B";
			} else if( ( m + f ) >= 50 ) {
				record ="C";
			} else if( ( m + f ) >= 30 ) {
				record ="D";
				if( r >= 50 ) {
					record ="C";
				}
			} else {
				record ="F";
			}
			System.out.println( record );
		}
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {

		int m = 0;
		int f = 0;
		int r = 0;
		String record ="";

		Scanner sc= new Scanner(System.in);

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

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

			if ( m == -1 || f == -1) {
				record ="F";
			} else if( ( m + f ) >= 80 ) {
				record ="A";
			} else if( ( m + f ) >= 65 ) {
				record ="B";
			} else if( ( m + f ) >= 50 ) {
				record ="C";
			} else if( ( m + f ) >= 30 ) {
				record ="D";
				if( r >= 50 ) {
					record ="C";
				}
			} else {
				record ="F";
			}
			System.out.println( record );
		}
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int m = 0;
		int f = 0;
		int r = 0;
		String record ="";

		Scanner sc= new Scanner(System.in);

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

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

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