import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;


public class Main {
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> M = new ArrayList<Integer>();
		List <Integer> F = new ArrayList<Integer>();
		List <Integer> R = new ArrayList<Integer>();
		int m;
		int f;
		int r;
		do {
			m = stdIn.nextInt();
			f = stdIn.nextInt();
			r = stdIn.nextInt();
			M.add(m);
			F.add(f);
			R.add(r);
		} while (m != -1 || f != -1 || r != -1);
		
		
		for(int i = 0; i < M.size()-1; i++) {
			if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			}
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> M = new ArrayList<Integer>();
		List <Integer> F = new ArrayList<Integer>();
		List <Integer> R = new ArrayList<Integer>();
		int m;
		int f;
		int r;
		do {
			m = stdIn.nextInt();
			f = stdIn.nextInt();
			r = stdIn.nextInt();
			M.add(m);
			F.add(f);
			R.add(r);
		} while (m != -1 || f != -1 || r != -1);
		
		
		for(int i = 0; i < M.size()-1; i++) {
			if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> M = new ArrayList<Integer>();
		List <Integer> F = new ArrayList<Integer>();
		List <Integer> R = new ArrayList<Integer>();
		int m;
		int f;
		int r;
		do {
			m = stdIn.nextInt();
			f = stdIn.nextInt();
			r = stdIn.nextInt();
			M.add(m);
			F.add(f);
			R.add(r);
		} while (m != -1 || f != -1 || r != -1);
		
		
		for(int i = 0; i < M.size()-1; i++) {
			if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			}
		}
	} main {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> M = new ArrayList<Integer>();
		List <Integer> F = new ArrayList<Integer>();
		List <Integer> R = new ArrayList<Integer>();
		int m;
		int f;
		int r;
		do {
			m = stdIn.nextInt();
			f = stdIn.nextInt();
			r = stdIn.nextInt();
			M.add(m);
			F.add(f);
			R.add(r);
		} while (m != -1 || f != -1 || r != -1);
		
		
		for(int i = 0; i < M.size()-1; i++) {
			if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			}
		}
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) List <Integer> M = new ArrayList<Integer>(); M new ArrayList<Integer>() List <Integer> F = new ArrayList<Integer>(); F new ArrayList<Integer>() List <Integer> R = new ArrayList<Integer>(); R new ArrayList<Integer>() int m; m int f; f int r; r do {
			m = stdIn.nextInt();
			f = stdIn.nextInt();
			r = stdIn.nextInt();
			M.add(m);
			F.add(f);
			R.add(r);
		} while (m != -1 || f != -1 || r != -1); 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 {
			m = stdIn.nextInt();
			f = stdIn.nextInt();
			r = stdIn.nextInt();
			M.add(m);
			F.add(f);
			R.add(r);
		} m = stdIn.nextInt() m stdIn.nextInt() stdIn.nextInt stdIn f = stdIn.nextInt() f stdIn.nextInt() stdIn.nextInt stdIn r = stdIn.nextInt() r stdIn.nextInt() stdIn.nextInt stdIn M.add(m) M.add M m F.add(f) F.add F f R.add(r) R.add R r for(int i = 0; i < M.size()-1; i++) {
			if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			}
		} int i = 0; int i = 0; i 0 i < M.size()-1 i M.size()-1 M.size() M.size M 1 i++ i++ i {
			if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			}
		} {
			if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			}
		} if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			} M.get(i) == -1 || F.get(i) == -1 M.get(i) == -1 M.get(i) M.get M i -1 1 F.get(i) == -1 F.get(i) F.get F i -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			} int tmp = M.get(i) + F.get(i); tmp M.get(i) + F.get(i) M.get(i) M.get M i F.get(i) F.get F i if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				} tmp >= 80 tmp 80 {
					System.out.println("A");
				} System.out.println("A") System.out.println System.out System System.out "A" if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				} tmp >= 65 tmp 65 {
					System.out.println("B");
				} System.out.println("B") System.out.println System.out System System.out "B" if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				} tmp >= 50 tmp 50 {
					System.out.println("C");
				} System.out.println("C") System.out.println System.out System System.out "C" if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				} tmp >= 30 tmp 30 {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				} if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					} R.get(i) >= 50 R.get(i) R.get R i 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" {
					System.out.println("F");
				} System.out.println("F") System.out.println System.out System System.out "F" String[] args args public class Main {
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> M = new ArrayList<Integer>();
		List <Integer> F = new ArrayList<Integer>();
		List <Integer> R = new ArrayList<Integer>();
		int m;
		int f;
		int r;
		do {
			m = stdIn.nextInt();
			f = stdIn.nextInt();
			r = stdIn.nextInt();
			M.add(m);
			F.add(f);
			R.add(r);
		} while (m != -1 || f != -1 || r != -1);
		
		
		for(int i = 0; i < M.size()-1; i++) {
			if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			}
		}
	}
} public class Main {
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> M = new ArrayList<Integer>();
		List <Integer> F = new ArrayList<Integer>();
		List <Integer> R = new ArrayList<Integer>();
		int m;
		int f;
		int r;
		do {
			m = stdIn.nextInt();
			f = stdIn.nextInt();
			r = stdIn.nextInt();
			M.add(m);
			F.add(f);
			R.add(r);
		} while (m != -1 || f != -1 || r != -1);
		
		
		for(int i = 0; i < M.size()-1; i++) {
			if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			}
		}
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;


public class Main {
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> M = new ArrayList<Integer>();
		List <Integer> F = new ArrayList<Integer>();
		List <Integer> R = new ArrayList<Integer>();
		int m;
		int f;
		int r;
		do {
			m = stdIn.nextInt();
			f = stdIn.nextInt();
			r = stdIn.nextInt();
			M.add(m);
			F.add(f);
			R.add(r);
		} while (m != -1 || f != -1 || r != -1);
		
		
		for(int i = 0; i < M.size()-1; i++) {
			if(M.get(i) == -1 || F.get(i) == -1) {
				System.out.println("F");
			}
			else {
				int tmp = M.get(i) + F.get(i);
				if(tmp >= 80) {
					System.out.println("A");
				}
				else if (tmp >= 65) {
					System.out.println("B");
				}
				else if (tmp >= 50) {
					System.out.println("C");
				}
				else if(tmp >= 30) {
					if(R.get(i) >= 50) {
						System.out.println("C");
					}
					else {
						System.out.println("D");
					}
				}
				else {
					System.out.println("F");
				}
			}
		}
	}
}