import java.util.Scanner;

public class Main {
	private static Scanner sc=new Scanner(System.in);
	public static void main (String[] args){
		while(true){
			int m=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			char result=judge(m,f,r);
			System.out.println(result);
		}
	}
	private static char judge(int m,int f,int r){
		if(m==-1||f==-1) return 'F';
		if(m+f>=80) return 'A';
		else if(m+f>=65) return 'B';
		else if(m+f>=50) return 'C';
		else if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F';
	}
} import java.util.Scanner; Scanner java.util public class Main {
	private static Scanner sc=new Scanner(System.in);
	public static void main (String[] args){
		while(true){
			int m=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			char result=judge(m,f,r);
			System.out.println(result);
		}
	}
	private static char judge(int m,int f,int r){
		if(m==-1||f==-1) return 'F';
		if(m+f>=80) return 'A';
		else if(m+f>=65) return 'B';
		else if(m+f>=50) return 'C';
		else if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F';
	}
} Main private static Scanner sc=new Scanner(System.in); sc new Scanner(System.in) public static void main (String[] args){
		while(true){
			int m=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			char result=judge(m,f,r);
			System.out.println(result);
		}
	} main {
		while(true){
			int m=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			char result=judge(m,f,r);
			System.out.println(result);
		}
	} while(true){
			int m=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			char result=judge(m,f,r);
			System.out.println(result);
		} true {
			int m=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			char result=judge(m,f,r);
			System.out.println(result);
		} int m=sc.nextInt(); m sc.nextInt() sc.nextInt sc int f=sc.nextInt(); f sc.nextInt() sc.nextInt sc int r=sc.nextInt(); r sc.nextInt() sc.nextInt sc 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; char result=judge(m,f,r); result judge(m,f,r) judge m f r System.out.println(result) System.out.println System.out System System.out result String[] args args private static char judge(int m,int f,int r){
		if(m==-1||f==-1) return 'F';
		if(m+f>=80) return 'A';
		else if(m+f>=65) return 'B';
		else if(m+f>=50) return 'C';
		else if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F';
	} judge {
		if(m==-1||f==-1) return 'F';
		if(m+f>=80) return 'A';
		else if(m+f>=65) return 'B';
		else if(m+f>=50) return 'C';
		else if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F';
	} if(m==-1||f==-1) return 'F'; m==-1||f==-1 m==-1 m -1 1 f==-1 f -1 1 return 'F'; 'F' if(m+f>=80) return 'A';
		else if(m+f>=65) return 'B';
		else if(m+f>=50) return 'C';
		else if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F'; m+f>=80 m+f m f 80 return 'A'; 'A' if(m+f>=65) return 'B';
		else if(m+f>=50) return 'C';
		else if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F'; m+f>=65 m+f m f 65 return 'B'; 'B' if(m+f>=50) return 'C';
		else if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F'; m+f>=50 m+f m f 50 return 'C'; 'C' if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F'; m+f>=30&&r>=50 m+f>=30 m+f m f 30 r>=50 r 50 return 'C'; 'C' if(m+f>=30) return 'D';
		else return 'F'; m+f>=30 m+f m f 30 return 'D'; 'D' return 'F'; 'F' int m m int f f int r r public class Main {
	private static Scanner sc=new Scanner(System.in);
	public static void main (String[] args){
		while(true){
			int m=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			char result=judge(m,f,r);
			System.out.println(result);
		}
	}
	private static char judge(int m,int f,int r){
		if(m==-1||f==-1) return 'F';
		if(m+f>=80) return 'A';
		else if(m+f>=65) return 'B';
		else if(m+f>=50) return 'C';
		else if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F';
	}
} public class Main {
	private static Scanner sc=new Scanner(System.in);
	public static void main (String[] args){
		while(true){
			int m=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			char result=judge(m,f,r);
			System.out.println(result);
		}
	}
	private static char judge(int m,int f,int r){
		if(m==-1||f==-1) return 'F';
		if(m+f>=80) return 'A';
		else if(m+f>=65) return 'B';
		else if(m+f>=50) return 'C';
		else if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F';
	}
} Main
import java.util.Scanner;

public class Main {
	private static Scanner sc=new Scanner(System.in);
	public static void main (String[] args){
		while(true){
			int m=sc.nextInt();
			int f=sc.nextInt();
			int r=sc.nextInt();
			if(m==-1&&f==-1&&r==-1) break;
			char result=judge(m,f,r);
			System.out.println(result);
		}
	}
	private static char judge(int m,int f,int r){
		if(m==-1||f==-1) return 'F';
		if(m+f>=80) return 'A';
		else if(m+f>=65) return 'B';
		else if(m+f>=50) return 'C';
		else if(m+f>=30&&r>=50) return 'C';
		else if(m+f>=30) return 'D';
		else return 'F';
	}
}