import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{
	public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			
			if((m == -1) || (f == -1)){
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			}
			else if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			}
		}
		System.out.print(sb);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main{
	public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			
			if((m == -1) || (f == -1)){
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			}
			else if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			}
		}
		System.out.print(sb);
	}
} Main public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			
			if((m == -1) || (f == -1)){
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			}
			else if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			}
		}
		System.out.print(sb);
	} main {
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			
			if((m == -1) || (f == -1)){
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			}
			else if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			}
		}
		System.out.print(sb);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			
			if((m == -1) || (f == -1)){
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			}
			else if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			}
		} true {
			String line = br.readLine();
			String[] str = line.split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			
			if((m == -1) || (f == -1)){
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			}
			else if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			}
		} String line = br.readLine(); line br.readLine() br.readLine br String[] str = line.split(" "); str line.split(" ") line.split line " " int m = Integer.parseInt(str[0]); m Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int f = Integer.parseInt(str[1]); f Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int r = Integer.parseInt(str[2]); r Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 if((m == -1) || (f == -1)){
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			}
			else if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			} (m == -1) || (f == -1) (m == -1) m -1 1 (f == -1) f -1 1 {
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			} if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				} (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; {
					sb.append("F\n");
				} sb.append("F\n") sb.append sb "F\n" if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			} 80 <= m + f 80 m + f m f {
				sb.append("A\n");
			} sb.append("A\n") sb.append sb "A\n" if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			} (65 <= m + f) && (m + f < 80) (65 <= m + f) 65 m + f m f (m + f < 80) m + f m f 80 {
				sb.append("B\n");
			} sb.append("B\n") sb.append sb "B\n" if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			} (50 <= m + f) && (m + f < 65) (50 <= m + f) 50 m + f m f (m + f < 65) m + f m f 65 {
				sb.append("C\n");
			} sb.append("C\n") sb.append sb "C\n" if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			} (30 <= m + f) && (m + f < 50) (30 <= m + f) 30 m + f m f (m + f < 50) m + f m f 50 {
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			} if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				} 50 <= r 50 r {
					sb.append("C\n");
				} sb.append("C\n") sb.append sb "C\n" {
					sb.append("D\n");
				} sb.append("D\n") sb.append sb "D\n" if(m + f < 30){
				sb.append("F\n");
			} m + f < 30 m + f m f 30 {
				sb.append("F\n");
			} sb.append("F\n") sb.append sb "F\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main{
	public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			
			if((m == -1) || (f == -1)){
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			}
			else if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			}
		}
		System.out.print(sb);
	}
} public class Main{
	public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			
			if((m == -1) || (f == -1)){
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			}
			else if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			}
		}
		System.out.print(sb);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main{
	public static void main(String[] args)throws IOException{
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		
		while(true){
			String line = br.readLine();
			String[] str = line.split(" ");
			int m = Integer.parseInt(str[0]);
			int f = Integer.parseInt(str[1]);
			int r = Integer.parseInt(str[2]);
			
			if((m == -1) || (f == -1)){
				if((m == -1) && (f == -1) && (r == -1)){
					break;
				}
				else{
					sb.append("F\n");
				}
			}
			else if(80 <= m + f){
				sb.append("A\n");
			}
			else if((65 <= m + f) && (m + f < 80)){
				sb.append("B\n");
			}
			else if((50 <= m + f) && (m + f < 65)){
				sb.append("C\n");
			}
			else if((30 <= m + f) && (m + f < 50)){
				if(50 <= r){
					sb.append("C\n");
				}
				else{
					sb.append("D\n");
				}
			}
			else if(m + f < 30){
				sb.append("F\n");
			}
		}
		System.out.print(sb);
	}
}