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