import java.util.*;

class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		final String lb = System.getProperty("line.separator");
		StringBuilder sb = new StringBuilder();

		while(true){
			final String[] points = sc.nextLine().split(" ");
			final int mid = Integer.parseInt(points[0]);
			final int fin = Integer.parseInt(points[1]);
			final int ret = Integer.parseInt(points[2]);
			
			if(mid == -1 && fin == -1 && ret == -1) break;

			if(mid == -1 || fin == -1){
				sb.append("F").append(lb);
			} else if((mid + fin) >= 80){
				sb.append("A").append(lb);
			} else if((mid + fin) >= 65){
				sb.append("B").append(lb);
			} else if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			}
		}
		System.out.print(sb.toString());
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		final String lb = System.getProperty("line.separator");
		StringBuilder sb = new StringBuilder();

		while(true){
			final String[] points = sc.nextLine().split(" ");
			final int mid = Integer.parseInt(points[0]);
			final int fin = Integer.parseInt(points[1]);
			final int ret = Integer.parseInt(points[2]);
			
			if(mid == -1 && fin == -1 && ret == -1) break;

			if(mid == -1 || fin == -1){
				sb.append("F").append(lb);
			} else if((mid + fin) >= 80){
				sb.append("A").append(lb);
			} else if((mid + fin) >= 65){
				sb.append("B").append(lb);
			} else if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			}
		}
		System.out.print(sb.toString());
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		final String lb = System.getProperty("line.separator");
		StringBuilder sb = new StringBuilder();

		while(true){
			final String[] points = sc.nextLine().split(" ");
			final int mid = Integer.parseInt(points[0]);
			final int fin = Integer.parseInt(points[1]);
			final int ret = Integer.parseInt(points[2]);
			
			if(mid == -1 && fin == -1 && ret == -1) break;

			if(mid == -1 || fin == -1){
				sb.append("F").append(lb);
			} else if((mid + fin) >= 80){
				sb.append("A").append(lb);
			} else if((mid + fin) >= 65){
				sb.append("B").append(lb);
			} else if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			}
		}
		System.out.print(sb.toString());
	} main {
		Scanner sc = new Scanner(System.in);
		final String lb = System.getProperty("line.separator");
		StringBuilder sb = new StringBuilder();

		while(true){
			final String[] points = sc.nextLine().split(" ");
			final int mid = Integer.parseInt(points[0]);
			final int fin = Integer.parseInt(points[1]);
			final int ret = Integer.parseInt(points[2]);
			
			if(mid == -1 && fin == -1 && ret == -1) break;

			if(mid == -1 || fin == -1){
				sb.append("F").append(lb);
			} else if((mid + fin) >= 80){
				sb.append("A").append(lb);
			} else if((mid + fin) >= 65){
				sb.append("B").append(lb);
			} else if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			}
		}
		System.out.print(sb.toString());
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final String lb = System.getProperty("line.separator"); lb System.getProperty("line.separator") System.getProperty System "line.separator" StringBuilder sb = new StringBuilder(); sb new StringBuilder() while(true){
			final String[] points = sc.nextLine().split(" ");
			final int mid = Integer.parseInt(points[0]);
			final int fin = Integer.parseInt(points[1]);
			final int ret = Integer.parseInt(points[2]);
			
			if(mid == -1 && fin == -1 && ret == -1) break;

			if(mid == -1 || fin == -1){
				sb.append("F").append(lb);
			} else if((mid + fin) >= 80){
				sb.append("A").append(lb);
			} else if((mid + fin) >= 65){
				sb.append("B").append(lb);
			} else if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			}
		} true {
			final String[] points = sc.nextLine().split(" ");
			final int mid = Integer.parseInt(points[0]);
			final int fin = Integer.parseInt(points[1]);
			final int ret = Integer.parseInt(points[2]);
			
			if(mid == -1 && fin == -1 && ret == -1) break;

			if(mid == -1 || fin == -1){
				sb.append("F").append(lb);
			} else if((mid + fin) >= 80){
				sb.append("A").append(lb);
			} else if((mid + fin) >= 65){
				sb.append("B").append(lb);
			} else if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			}
		} final String[] points = sc.nextLine().split(" "); points sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " final int mid = Integer.parseInt(points[0]); mid Integer.parseInt(points[0]) Integer.parseInt Integer points[0] points 0 final int fin = Integer.parseInt(points[1]); fin Integer.parseInt(points[1]) Integer.parseInt Integer points[1] points 1 final int ret = Integer.parseInt(points[2]); ret Integer.parseInt(points[2]) Integer.parseInt Integer points[2] points 2 if(mid == -1 && fin == -1 && ret == -1) break; mid == -1 && fin == -1 && ret == -1 mid == -1 && fin == -1 && ret == -1 mid == -1 mid -1 1 fin == -1 fin -1 1 ret == -1 ret -1 1 break; if(mid == -1 || fin == -1){
				sb.append("F").append(lb);
			} else if((mid + fin) >= 80){
				sb.append("A").append(lb);
			} else if((mid + fin) >= 65){
				sb.append("B").append(lb);
			} else if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			} mid == -1 || fin == -1 mid == -1 mid -1 1 fin == -1 fin -1 1 {
				sb.append("F").append(lb);
			} sb.append("F").append(lb) sb.append("F").append sb.append("F") sb.append sb "F" lb if((mid + fin) >= 80){
				sb.append("A").append(lb);
			} else if((mid + fin) >= 65){
				sb.append("B").append(lb);
			} else if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			} (mid + fin) >= 80 (mid + fin) mid fin 80 {
				sb.append("A").append(lb);
			} sb.append("A").append(lb) sb.append("A").append sb.append("A") sb.append sb "A" lb if((mid + fin) >= 65){
				sb.append("B").append(lb);
			} else if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			} (mid + fin) >= 65 (mid + fin) mid fin 65 {
				sb.append("B").append(lb);
			} sb.append("B").append(lb) sb.append("B").append sb.append("B") sb.append sb "B" lb if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			} (mid + fin) >= 50 (mid + fin) mid fin 50 {
				sb.append("C").append(lb);
			} sb.append("C").append(lb) sb.append("C").append sb.append("C") sb.append sb "C" lb if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			} (mid + fin) >= 30 (mid + fin) mid fin 30 {
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				} ret >= 50 ret 50 {
					sb.append("C").append(lb);
				} sb.append("C").append(lb) sb.append("C").append sb.append("C") sb.append sb "C" lb {
					sb.append("D").append(lb);
				} sb.append("D").append(lb) sb.append("D").append sb.append("D") sb.append sb "D" lb {
				sb.append("F").append(lb);
			} sb.append("F").append(lb) sb.append("F").append sb.append("F") sb.append sb "F" lb System.out.print(sb.toString()) System.out.print System.out System System.out sb.toString() sb.toString sb String[] args args
import java.util.*;

class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		final String lb = System.getProperty("line.separator");
		StringBuilder sb = new StringBuilder();

		while(true){
			final String[] points = sc.nextLine().split(" ");
			final int mid = Integer.parseInt(points[0]);
			final int fin = Integer.parseInt(points[1]);
			final int ret = Integer.parseInt(points[2]);
			
			if(mid == -1 && fin == -1 && ret == -1) break;

			if(mid == -1 || fin == -1){
				sb.append("F").append(lb);
			} else if((mid + fin) >= 80){
				sb.append("A").append(lb);
			} else if((mid + fin) >= 65){
				sb.append("B").append(lb);
			} else if((mid + fin) >= 50){
				sb.append("C").append(lb);
			} else if((mid + fin) >= 30){
				if(ret >= 50){
					sb.append("C").append(lb);
				} else {
					sb.append("D").append(lb);
				}
			} else {
				sb.append("F").append(lb);
			}
		}
		System.out.print(sb.toString());
	}
}