import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int m, f, r;
		while(true) {
			m = in.nextInt();
			f = in.nextInt();
			r = in.nextInt();
			if(m == -1 && f == -1 && r == -1) break;

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

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

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

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

			char ch = 'F';
			int mf = m+f;
			if(m == -1 || f == -1) {
				ch = 'F';
			}
			else if(mf >= 80) {
				ch = 'A';
			}
			else if(65 <= mf) {
				ch = 'B';
			}
			else if(50 <= mf) {
				ch = 'C';
			}
			else if(30 <= mf) {
				ch = 'D';
				if(50 <= r) {
					ch = 'C';
				}
			}
			System.out.println(ch);
		} true {
			m = in.nextInt();
			f = in.nextInt();
			r = in.nextInt();
			if(m == -1 && f == -1 && r == -1) break;

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

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

			char ch = 'F';
			int mf = m+f;
			if(m == -1 || f == -1) {
				ch = 'F';
			}
			else if(mf >= 80) {
				ch = 'A';
			}
			else if(65 <= mf) {
				ch = 'B';
			}
			else if(50 <= mf) {
				ch = 'C';
			}
			else if(30 <= mf) {
				ch = 'D';
				if(50 <= r) {
					ch = 'C';
				}
			}
			System.out.println(ch);
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int m, f, r;
		while(true) {
			m = in.nextInt();
			f = in.nextInt();
			r = in.nextInt();
			if(m == -1 && f == -1 && r == -1) break;

			char ch = 'F';
			int mf = m+f;
			if(m == -1 || f == -1) {
				ch = 'F';
			}
			else if(mf >= 80) {
				ch = 'A';
			}
			else if(65 <= mf) {
				ch = 'B';
			}
			else if(50 <= mf) {
				ch = 'C';
			}
			else if(30 <= mf) {
				ch = 'D';
				if(50 <= r) {
					ch = 'C';
				}
			}
			System.out.println(ch);
		}
	}
}