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