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) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (scan.hasNext()) {
			String input = scan.nextLine();
			String[] in = input.split(" ");
			int m = Integer.parseInt(in[0]);
			int f = Integer.parseInt(in[1]);
			int r = Integer.parseInt(in[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (scan.hasNext()) {
			String input = scan.nextLine();
			String[] in = input.split(" ");
			int m = Integer.parseInt(in[0]);
			int f = Integer.parseInt(in[1]);
			int r = Integer.parseInt(in[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (scan.hasNext()) {
			String input = scan.nextLine();
			String[] in = input.split(" ");
			int m = Integer.parseInt(in[0]);
			int f = Integer.parseInt(in[1]);
			int r = Integer.parseInt(in[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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 {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (scan.hasNext()) {
			String input = scan.nextLine();
			String[] in = input.split(" ");
			int m = Integer.parseInt(in[0]);
			int f = Integer.parseInt(in[1]);
			int r = Integer.parseInt(in[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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);
		}
	} @SuppressWarnings("resource")
		Scanner scan = new Scanner(new BufferedInputStream(System.in)); scan new Scanner(new BufferedInputStream(System.in)) List<String> output = new ArrayList<String>(); output new ArrayList<String>() while (scan.hasNext()) {
			String input = scan.nextLine();
			String[] in = input.split(" ");
			int m = Integer.parseInt(in[0]);
			int f = Integer.parseInt(in[1]);
			int r = Integer.parseInt(in[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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");
					}
				}
			}
		} scan.hasNext() scan.hasNext scan {
			String input = scan.nextLine();
			String[] in = input.split(" ");
			int m = Integer.parseInt(in[0]);
			int f = Integer.parseInt(in[1]);
			int r = Integer.parseInt(in[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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 = scan.nextLine(); input scan.nextLine() scan.nextLine scan String[] in = input.split(" "); in input.split(" ") input.split input " " int m = Integer.parseInt(in[0]); m Integer.parseInt(in[0]) Integer.parseInt Integer in[0] in 0 int f = Integer.parseInt(in[1]); f Integer.parseInt(in[1]) Integer.parseInt Integer in[1] in 1 int r = Integer.parseInt(in[2]); r Integer.parseInt(in[2]) Integer.parseInt Integer in[2] in 2 if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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 && 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 {
					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");
					}
				}
			} if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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" {
					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");
					}
				} 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) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (scan.hasNext()) {
			String input = scan.nextLine();
			String[] in = input.split(" ");
			int m = Integer.parseInt(in[0]);
			int f = Integer.parseInt(in[1]);
			int r = Integer.parseInt(in[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (scan.hasNext()) {
			String input = scan.nextLine();
			String[] in = input.split(" ");
			int m = Integer.parseInt(in[0]);
			int f = Integer.parseInt(in[1]);
			int r = Integer.parseInt(in[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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) {
		@SuppressWarnings("resource")
		Scanner scan = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (scan.hasNext()) {
			String input = scan.nextLine();
			String[] in = input.split(" ");
			int m = Integer.parseInt(in[0]);
			int f = Integer.parseInt(in[1]);
			int r = Integer.parseInt(in[2]);
			if (m == -1 && f == -1 && r == -1) {
				break;
			} else {
				if (m == -1 || f == -1) {
					output.add("F");
				} else {
					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);
		}
	}
}