import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int m = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			String grade = "";
			if(m==-1 && f==-1 && r==-1){
				break;
			}else{
				if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				}
			}
			System.out.println(grade);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int m = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			String grade = "";
			if(m==-1 && f==-1 && r==-1){
				break;
			}else{
				if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				}
			}
			System.out.println(grade);
		}
	}
} Main public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int m = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			String grade = "";
			if(m==-1 && f==-1 && r==-1){
				break;
			}else{
				if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				}
			}
			System.out.println(grade);
		}
	} main {
		Scanner std = new Scanner(System.in);
		while(true){
			int m = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			String grade = "";
			if(m==-1 && f==-1 && r==-1){
				break;
			}else{
				if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				}
			}
			System.out.println(grade);
		}
	} Scanner std = new Scanner(System.in); std new Scanner(System.in) while(true){
			int m = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			String grade = "";
			if(m==-1 && f==-1 && r==-1){
				break;
			}else{
				if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				}
			}
			System.out.println(grade);
		} true {
			int m = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			String grade = "";
			if(m==-1 && f==-1 && r==-1){
				break;
			}else{
				if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				}
			}
			System.out.println(grade);
		} int m = Integer.parseInt(std.next()); m Integer.parseInt(std.next()) Integer.parseInt Integer std.next() std.next std int f = Integer.parseInt(std.next()); f Integer.parseInt(std.next()) Integer.parseInt Integer std.next() std.next std int r = Integer.parseInt(std.next()); r Integer.parseInt(std.next()) Integer.parseInt Integer std.next() std.next std String grade = ""; grade "" if(m==-1 && f==-1 && r==-1){
				break;
			}else{
				if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "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){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				}
			} if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				} m==-1 || f==-1 m==-1 m -1 1 f==-1 f -1 1 {
					grade = "F";
				} grade = "F" grade "F" if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				} m+f>=80 m+f m f 80 {
					grade = "A";
				} grade = "A" grade "A" if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				} m+f>=65 m+f m f 65 {
					grade = "B";
				} grade = "B" grade "B" if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				} m+f>=50 m+f m f 50 {
					grade = "C";
				} grade = "C" grade "C" if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				} m+f>=30 m+f m f 30 {
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				} if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					} r>=50 r 50 {
						grade = "C";
					} grade = "C" grade "C" {
						grade = "D";
					} grade = "D" grade "D" {
					grade = "F";
				} grade = "F" grade "F" System.out.println(grade) System.out.println System.out System System.out grade String[] args args public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int m = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			String grade = "";
			if(m==-1 && f==-1 && r==-1){
				break;
			}else{
				if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				}
			}
			System.out.println(grade);
		}
	}
} public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int m = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			String grade = "";
			if(m==-1 && f==-1 && r==-1){
				break;
			}else{
				if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				}
			}
			System.out.println(grade);
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int m = Integer.parseInt(std.next());
			int f = Integer.parseInt(std.next());
			int r = Integer.parseInt(std.next());
			String grade = "";
			if(m==-1 && f==-1 && r==-1){
				break;
			}else{
				if(m==-1 || f==-1){
					grade = "F";
				}else if(m+f>=80){
					grade = "A";
				}else if(m+f>=65){
					grade = "B";
				}else if(m+f>=50){
					grade = "C";
				}else if(m+f>=30){
					if(r>=50){
						grade = "C";
					}else{
						grade = "D";
					}
				}else {
					grade = "F";
				}
			}
			System.out.println(grade);
		}
	}
}