import java.util.Scanner;

public class Main {
	public static Scanner sc;
	
	public static void main(String args[]){
		//System.out.println("Please input grades below");
		//宣言
		sc = new Scanner(System.in);
		int m[]= new int[500];
		int f[]= new int[500];
		int r[]= new int[500];
		int s[]= new int[500];
		int i=1;
		//入力
		for(;;) {
			m[i]=sc.nextInt();
			f[i]=sc.nextInt();
			r[i]=sc.nextInt();
			s[i]=m[i]+f[i];
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			i++;
		}
		i=1;
		
		//出力
		for(;;) {
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			//System.out.println(s[i]);
			if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			}
			i++;
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static Scanner sc;
	
	public static void main(String args[]){
		//System.out.println("Please input grades below");
		//宣言
		sc = new Scanner(System.in);
		int m[]= new int[500];
		int f[]= new int[500];
		int r[]= new int[500];
		int s[]= new int[500];
		int i=1;
		//入力
		for(;;) {
			m[i]=sc.nextInt();
			f[i]=sc.nextInt();
			r[i]=sc.nextInt();
			s[i]=m[i]+f[i];
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			i++;
		}
		i=1;
		
		//出力
		for(;;) {
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			//System.out.println(s[i]);
			if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			}
			i++;
		}
	}
} Main public static Scanner sc; sc public static void main(String args[]){
		//System.out.println("Please input grades below");
		//宣言
		sc = new Scanner(System.in);
		int m[]= new int[500];
		int f[]= new int[500];
		int r[]= new int[500];
		int s[]= new int[500];
		int i=1;
		//入力
		for(;;) {
			m[i]=sc.nextInt();
			f[i]=sc.nextInt();
			r[i]=sc.nextInt();
			s[i]=m[i]+f[i];
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			i++;
		}
		i=1;
		
		//出力
		for(;;) {
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			//System.out.println(s[i]);
			if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			}
			i++;
		}
	} main {
		//System.out.println("Please input grades below");
		//宣言
		sc = new Scanner(System.in);
		int m[]= new int[500];
		int f[]= new int[500];
		int r[]= new int[500];
		int s[]= new int[500];
		int i=1;
		//入力
		for(;;) {
			m[i]=sc.nextInt();
			f[i]=sc.nextInt();
			r[i]=sc.nextInt();
			s[i]=m[i]+f[i];
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			i++;
		}
		i=1;
		
		//出力
		for(;;) {
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			//System.out.println(s[i]);
			if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			}
			i++;
		}
	} sc = new Scanner(System.in) sc new Scanner(System.in) int m[]= new int[500]; m new int[500] 500 int f[]= new int[500]; f new int[500] 500 int r[]= new int[500]; r new int[500] 500 int s[]= new int[500]; s new int[500] 500 int i=1; i 1 for(;;) {
			m[i]=sc.nextInt();
			f[i]=sc.nextInt();
			r[i]=sc.nextInt();
			s[i]=m[i]+f[i];
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			i++;
		} ; {
			m[i]=sc.nextInt();
			f[i]=sc.nextInt();
			r[i]=sc.nextInt();
			s[i]=m[i]+f[i];
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			i++;
		} {
			m[i]=sc.nextInt();
			f[i]=sc.nextInt();
			r[i]=sc.nextInt();
			s[i]=m[i]+f[i];
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			i++;
		} m[i]=sc.nextInt() m[i] m i sc.nextInt() sc.nextInt sc f[i]=sc.nextInt() f[i] f i sc.nextInt() sc.nextInt sc r[i]=sc.nextInt() r[i] r i sc.nextInt() sc.nextInt sc s[i]=m[i]+f[i] s[i] s i m[i]+f[i] m[i] m i f[i] f i if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			} m[i]==-1 &&f[i]==-1 &&r[i]==-1 m[i]==-1 &&f[i]==-1 &&r[i]==-1 m[i]==-1 m[i] m i -1 1 f[i]==-1 f[i] f i -1 1 r[i]==-1 r[i] r i -1 1 {
				break;
			} break; i++ i i=1 i 1 for(;;) {
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			//System.out.println(s[i]);
			if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			}
			i++;
		} ; {
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			//System.out.println(s[i]);
			if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			}
			i++;
		} {
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			//System.out.println(s[i]);
			if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			}
			i++;
		} if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			} m[i]==-1 &&f[i]==-1 &&r[i]==-1 m[i]==-1 &&f[i]==-1 &&r[i]==-1 m[i]==-1 m[i] m i -1 1 f[i]==-1 f[i] f i -1 1 r[i]==-1 r[i] r i -1 1 {
				break;
			} break; if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			} m[i]==-1 ||f[i]==-1 m[i]==-1 m[i] m i -1 1 f[i]==-1 f[i] f i -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			} s[i]>=80 s[i] s i 80 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			} s[i]>=65 && s[i]<80 s[i]>=65 s[i] s i 65 s[i]<80 s[i] s i 80 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			} s[i]>=50 && s[i]<65 s[i]>=50 s[i] s i 50 s[i]<65 s[i] s i 65 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			} s[i]>=30 && s[i]<50 s[i]>=30 s[i] s i 30 s[i]<50 s[i] s i 50 {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			} if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				} r[i]>=50 r[i] r i 50 {
					System.out.println("C");
				} System.out.println("C") System.out.println System.out System System.out "C" {
					System.out.println("D");
				} System.out.println("D") System.out.println System.out System System.out "D" {System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" i++ i String args[] args public class Main {
	public static Scanner sc;
	
	public static void main(String args[]){
		//System.out.println("Please input grades below");
		//宣言
		sc = new Scanner(System.in);
		int m[]= new int[500];
		int f[]= new int[500];
		int r[]= new int[500];
		int s[]= new int[500];
		int i=1;
		//入力
		for(;;) {
			m[i]=sc.nextInt();
			f[i]=sc.nextInt();
			r[i]=sc.nextInt();
			s[i]=m[i]+f[i];
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			i++;
		}
		i=1;
		
		//出力
		for(;;) {
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			//System.out.println(s[i]);
			if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			}
			i++;
		}
	}
} public class Main {
	public static Scanner sc;
	
	public static void main(String args[]){
		//System.out.println("Please input grades below");
		//宣言
		sc = new Scanner(System.in);
		int m[]= new int[500];
		int f[]= new int[500];
		int r[]= new int[500];
		int s[]= new int[500];
		int i=1;
		//入力
		for(;;) {
			m[i]=sc.nextInt();
			f[i]=sc.nextInt();
			r[i]=sc.nextInt();
			s[i]=m[i]+f[i];
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			i++;
		}
		i=1;
		
		//出力
		for(;;) {
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			//System.out.println(s[i]);
			if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			}
			i++;
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static Scanner sc;
	
	public static void main(String args[]){
		//System.out.println("Please input grades below");
		//宣言
		sc = new Scanner(System.in);
		int m[]= new int[500];
		int f[]= new int[500];
		int r[]= new int[500];
		int s[]= new int[500];
		int i=1;
		//入力
		for(;;) {
			m[i]=sc.nextInt();
			f[i]=sc.nextInt();
			r[i]=sc.nextInt();
			s[i]=m[i]+f[i];
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			i++;
		}
		i=1;
		
		//出力
		for(;;) {
			if(m[i]==-1 &&f[i]==-1 &&r[i]==-1) {
				break;
			}
			//System.out.println(s[i]);
			if(m[i]==-1 ||f[i]==-1) {
				System.out.println("F");
			}else if(s[i]>=80) {
				System.out.println("A");
			}else if(s[i]>=65 && s[i]<80) {
				System.out.println("B");
			}else if(s[i]>=50 && s[i]<65) {
				System.out.println("C");
			}else if(s[i]>=30 && s[i]<50) {
				if(r[i]>=50) {
					System.out.println("C");
				}else {
					System.out.println("D");
				}
			}else {System.out.println("F");
			}
			i++;
		}
	}
}
