import java.io.BufferedInputStream;
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(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();

		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int m = Integer.parseInt(inputs[0]);
			int f = Integer.parseInt(inputs[1]);
			int r = Integer.parseInt(inputs[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} 
			if (m == -1 || f == -1) {
				output.add("F");
			}
			else {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			}
		}
		for (String out : output) {
			System.out.println(out);
		}
	}
} import java.io.BufferedInputStream; BufferedInputStream java.io 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(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();

		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int m = Integer.parseInt(inputs[0]);
			int f = Integer.parseInt(inputs[1]);
			int r = Integer.parseInt(inputs[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} 
			if (m == -1 || f == -1) {
				output.add("F");
			}
			else {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			}
		}
		for (String out : output) {
			System.out.println(out);
		}
	}
} Main public static void main(String[] args) {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();

		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int m = Integer.parseInt(inputs[0]);
			int f = Integer.parseInt(inputs[1]);
			int r = Integer.parseInt(inputs[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} 
			if (m == -1 || f == -1) {
				output.add("F");
			}
			else {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			}
		}
		for (String out : output) {
			System.out.println(out);
		}
	} main {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();

		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int m = Integer.parseInt(inputs[0]);
			int f = Integer.parseInt(inputs[1]);
			int r = Integer.parseInt(inputs[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} 
			if (m == -1 || f == -1) {
				output.add("F");
			}
			else {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			}
		}
		for (String out : output) {
			System.out.println(out);
		}
	} Scanner stdin = new Scanner(new BufferedInputStream(System.in)); stdin new Scanner(new BufferedInputStream(System.in)) List<String> output = new ArrayList<String>(); output new ArrayList<String>() while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int m = Integer.parseInt(inputs[0]);
			int f = Integer.parseInt(inputs[1]);
			int r = Integer.parseInt(inputs[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} 
			if (m == -1 || f == -1) {
				output.add("F");
			}
			else {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			}
		} stdin.hasNext() stdin.hasNext stdin {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int m = Integer.parseInt(inputs[0]);
			int f = Integer.parseInt(inputs[1]);
			int r = Integer.parseInt(inputs[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} 
			if (m == -1 || f == -1) {
				output.add("F");
			}
			else {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			}
		} String input = stdin.nextLine(); input stdin.nextLine() stdin.nextLine stdin String[] inputs = input.split(" "); inputs input.split(" ") input.split input " " int m = Integer.parseInt(inputs[0]); m Integer.parseInt(inputs[0]) Integer.parseInt Integer inputs[0] inputs 0 int f = Integer.parseInt(inputs[1]); f Integer.parseInt(inputs[1]) Integer.parseInt Integer inputs[1] inputs 1 int r = Integer.parseInt(inputs[2]); r Integer.parseInt(inputs[2]) Integer.parseInt Integer inputs[2] inputs 2 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) {
				output.add("F");
			}
			else {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
				output.add("F");
			} output.add("F") output.add output "F" {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			} String grade = ""; grade "" int total = m + f; total m + f m f if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				} total >= 80 total 80 {
					output.add( "A");
				} output.add( "A") output.add output "A" if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				} total >= 65 && total < 80 total >= 65 total 65 total < 80 total 80 {
					output.add("B");
				} output.add("B") output.add output "B" if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				} total >= 50 && total < 65 total >= 50 total 50 total < 65 total 65 {
					output.add("C");
				} output.add("C") output.add output "C" if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				} total >= 30 && total < 50 total >= 30 total 30 total < 50 total 50 {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					} r >= 50 r 50 {
						output.add("C");
					} output.add("C") output.add output "C" {
						output.add("D");
					} output.add("D") output.add output "D" if (total < 30) {
					output.add("F");
				} total < 30 total 30 {
					output.add("F");
				} output.add("F") output.add output "F" for (String out : output) {
			System.out.println(out);
		} String out output {
			System.out.println(out);
		} {
			System.out.println(out);
		} System.out.println(out) System.out.println System.out System System.out out String[] args args public class Main{
	public static void main(String[] args) {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();

		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int m = Integer.parseInt(inputs[0]);
			int f = Integer.parseInt(inputs[1]);
			int r = Integer.parseInt(inputs[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} 
			if (m == -1 || f == -1) {
				output.add("F");
			}
			else {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			}
		}
		for (String out : output) {
			System.out.println(out);
		}
	}
} public class Main{
	public static void main(String[] args) {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();

		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int m = Integer.parseInt(inputs[0]);
			int f = Integer.parseInt(inputs[1]);
			int r = Integer.parseInt(inputs[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} 
			if (m == -1 || f == -1) {
				output.add("F");
			}
			else {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			}
		}
		for (String out : output) {
			System.out.println(out);
		}
	}
} Main
import java.io.BufferedInputStream;
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(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();

		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int m = Integer.parseInt(inputs[0]);
			int f = Integer.parseInt(inputs[1]);
			int r = Integer.parseInt(inputs[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} 
			if (m == -1 || f == -1) {
				output.add("F");
			}
			else {
				
				String grade = "";
				int total = m + f;
				if (total >= 80) {
					output.add( "A");
				} else if (total >= 65 && total < 80) {
					output.add("B");
				} else if (total >= 50 && total < 65) {
					output.add("C");
				} else if (total >= 30 && total < 50) {
					if (r >= 50) {
						output.add("C");
					} else {
						output.add("D");
					}
				} else if (total < 30) {
					output.add("F");
				}
			}
		}
		for (String out : output) {
			System.out.println(out);
		}
	}
}