import java.util.*;

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

class Main {
	public static void main(String[] arg){
		Scanner in = new Scanner(System.in);
		char[]  score = {'A','B','C','D','F'};
		while(true){
			int m = Integer.parseInt(in.next());
			int f = Integer.parseInt(in.next());
			int r = Integer.parseInt(in.next());
			if(m==-1 && f==-1 && r==-1)
				break;
			else if(m==-1 || f==-1)
				System.out.println(score[4]);
			else if(m+f >= 80)
				System.out.println(score[0]);
			else if(m+f <80 && m+f>=65)
				System.out.println(score[1]);
			else if(m+f <65 && m+f>=50)
				System.out.println(score[2]);
			else if(m+f <50 && m+f>=30){
				if(r >=50) System.out.println(score[2]);
				else System.out.println(score[3]);
			}
			else if(m+f<30)
				System.out.println(score[4]);	
		}
	}	
}