//import java.util.ArrayList;
//import java.io.BufferedReader;
//import java.io.InputStreamReader;
//import java.io.IOException;
import java.io.*;
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Main test = new Main();
		test.run();
	}
	

	
	//Data????¨??????\???????????\?????????
	private void run(){
		BufferedReader buf= new BufferedReader(new InputStreamReader(System.in));
		
		do {
			int[] linedata;
			try{
				linedata = changeTestdata(buf.readLine());
			}catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			}
			
			if (checkInputDataLast(linedata)) break;
			System.out.println(judgeData(linedata));
			
		}while(true);
	}
	
	private int[] changeTestdata(String line){
		String[] sdata = line.split(" ");
		
		int[] data = new int[sdata.length];
		for (int i = 0; i < sdata.length; i++){
			try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			}
		}
		
		return data;
	}
	
	private boolean checkInputDataLast(int[] data){
		if (data.length != 3) return false;
		return (data[0] == -1 &&data[1] == -1 &&data[2] == -1) ;
	}
	
	private char judgeData(int[] test){
		if (test.length < 2) return 'F';
		if (test[0] == -1 || test[1] == -1) return 'F';
		if (test[0] + test[1] >= 80) return'A';
		if (test[0] + test[1] >= 65) return 'B';
		if (test[0] + test[1] >= 50) return 'C';
		if (test[0] + test[1] >= 30){
			if (test[2] >= 50) return 'C';
			else return 'D';
		}
		
		return 'F';
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
	
	public static void main(String[] args) {
		Main test = new Main();
		test.run();
	}
	

	
	//Data????¨??????\???????????\?????????
	private void run(){
		BufferedReader buf= new BufferedReader(new InputStreamReader(System.in));
		
		do {
			int[] linedata;
			try{
				linedata = changeTestdata(buf.readLine());
			}catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			}
			
			if (checkInputDataLast(linedata)) break;
			System.out.println(judgeData(linedata));
			
		}while(true);
	}
	
	private int[] changeTestdata(String line){
		String[] sdata = line.split(" ");
		
		int[] data = new int[sdata.length];
		for (int i = 0; i < sdata.length; i++){
			try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			}
		}
		
		return data;
	}
	
	private boolean checkInputDataLast(int[] data){
		if (data.length != 3) return false;
		return (data[0] == -1 &&data[1] == -1 &&data[2] == -1) ;
	}
	
	private char judgeData(int[] test){
		if (test.length < 2) return 'F';
		if (test[0] == -1 || test[1] == -1) return 'F';
		if (test[0] + test[1] >= 80) return'A';
		if (test[0] + test[1] >= 65) return 'B';
		if (test[0] + test[1] >= 50) return 'C';
		if (test[0] + test[1] >= 30){
			if (test[2] >= 50) return 'C';
			else return 'D';
		}
		
		return 'F';
	}
} Main public static void main(String[] args) {
		Main test = new Main();
		test.run();
	} main {
		Main test = new Main();
		test.run();
	} Main test = new Main(); test new Main() test.run() test.run test String[] args args //Data????¨??????\???????????\?????????
	private void run(){
		BufferedReader buf= new BufferedReader(new InputStreamReader(System.in));
		
		do {
			int[] linedata;
			try{
				linedata = changeTestdata(buf.readLine());
			}catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			}
			
			if (checkInputDataLast(linedata)) break;
			System.out.println(judgeData(linedata));
			
		}while(true);
	} run {
		BufferedReader buf= new BufferedReader(new InputStreamReader(System.in));
		
		do {
			int[] linedata;
			try{
				linedata = changeTestdata(buf.readLine());
			}catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			}
			
			if (checkInputDataLast(linedata)) break;
			System.out.println(judgeData(linedata));
			
		}while(true);
	} BufferedReader buf= new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) do {
			int[] linedata;
			try{
				linedata = changeTestdata(buf.readLine());
			}catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			}
			
			if (checkInputDataLast(linedata)) break;
			System.out.println(judgeData(linedata));
			
		}while(true); true {
			int[] linedata;
			try{
				linedata = changeTestdata(buf.readLine());
			}catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			}
			
			if (checkInputDataLast(linedata)) break;
			System.out.println(judgeData(linedata));
			
		} int[] linedata; linedata try{
				linedata = changeTestdata(buf.readLine());
			}catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			} catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			} IOException e {
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			} System.err.println(e.toString()) System.err.println System.err System System.err e.toString() e.toString e System.err.println("Input Error") System.err.println System.err System System.err "Input Error" continue; {
				linedata = changeTestdata(buf.readLine());
			} linedata = changeTestdata(buf.readLine()) linedata changeTestdata(buf.readLine()) changeTestdata buf.readLine() buf.readLine buf if (checkInputDataLast(linedata)) break; checkInputDataLast(linedata) checkInputDataLast linedata break; System.out.println(judgeData(linedata)) System.out.println System.out System System.out judgeData(linedata) judgeData linedata private int[] changeTestdata(String line){
		String[] sdata = line.split(" ");
		
		int[] data = new int[sdata.length];
		for (int i = 0; i < sdata.length; i++){
			try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			}
		}
		
		return data;
	} changeTestdata {
		String[] sdata = line.split(" ");
		
		int[] data = new int[sdata.length];
		for (int i = 0; i < sdata.length; i++){
			try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			}
		}
		
		return data;
	} String[] sdata = line.split(" "); sdata line.split(" ") line.split line " " int[] data = new int[sdata.length]; data new int[sdata.length] sdata.length sdata sdata.length for (int i = 0; i < sdata.length; i++){
			try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			}
		} int i = 0; int i = 0; i 0 i < sdata.length i sdata.length sdata sdata.length i++ i++ i {
			try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			}
		} {
			try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			}
		} try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			} catch(NumberFormatException e){
				data[i] = -2;
			} NumberFormatException e {
				data[i] = -2;
			} data[i] = -2 data[i] data i -2 2 {
				data[i] = Integer.parseInt(sdata[i]);
			} data[i] = Integer.parseInt(sdata[i]) data[i] data i Integer.parseInt(sdata[i]) Integer.parseInt Integer sdata[i] sdata i return data; data String line line private boolean checkInputDataLast(int[] data){
		if (data.length != 3) return false;
		return (data[0] == -1 &&data[1] == -1 &&data[2] == -1) ;
	} checkInputDataLast {
		if (data.length != 3) return false;
		return (data[0] == -1 &&data[1] == -1 &&data[2] == -1) ;
	} if (data.length != 3) return false; data.length != 3 data.length data data.length 3 return false; false return (data[0] == -1 &&data[1] == -1 &&data[2] == -1) ; (data[0] == -1 &&data[1] == -1 &&data[2] == -1) data[0] == -1 &&data[1] == -1 &&data[2] == -1 data[0] == -1 data[0] data 0 -1 1 data[1] == -1 data[1] data 1 -1 1 data[2] == -1 data[2] data 2 -1 1 int[] data data private char judgeData(int[] test){
		if (test.length < 2) return 'F';
		if (test[0] == -1 || test[1] == -1) return 'F';
		if (test[0] + test[1] >= 80) return'A';
		if (test[0] + test[1] >= 65) return 'B';
		if (test[0] + test[1] >= 50) return 'C';
		if (test[0] + test[1] >= 30){
			if (test[2] >= 50) return 'C';
			else return 'D';
		}
		
		return 'F';
	} judgeData {
		if (test.length < 2) return 'F';
		if (test[0] == -1 || test[1] == -1) return 'F';
		if (test[0] + test[1] >= 80) return'A';
		if (test[0] + test[1] >= 65) return 'B';
		if (test[0] + test[1] >= 50) return 'C';
		if (test[0] + test[1] >= 30){
			if (test[2] >= 50) return 'C';
			else return 'D';
		}
		
		return 'F';
	} if (test.length < 2) return 'F'; test.length < 2 test.length test test.length 2 return 'F'; 'F' if (test[0] == -1 || test[1] == -1) return 'F'; test[0] == -1 || test[1] == -1 test[0] == -1 test[0] test 0 -1 1 test[1] == -1 test[1] test 1 -1 1 return 'F'; 'F' if (test[0] + test[1] >= 80) return'A'; test[0] + test[1] >= 80 test[0] + test[1] test[0] test 0 test[1] test 1 80 return'A'; 'A' if (test[0] + test[1] >= 65) return 'B'; test[0] + test[1] >= 65 test[0] + test[1] test[0] test 0 test[1] test 1 65 return 'B'; 'B' if (test[0] + test[1] >= 50) return 'C'; test[0] + test[1] >= 50 test[0] + test[1] test[0] test 0 test[1] test 1 50 return 'C'; 'C' if (test[0] + test[1] >= 30){
			if (test[2] >= 50) return 'C';
			else return 'D';
		} test[0] + test[1] >= 30 test[0] + test[1] test[0] test 0 test[1] test 1 30 {
			if (test[2] >= 50) return 'C';
			else return 'D';
		} if (test[2] >= 50) return 'C';
			else return 'D'; test[2] >= 50 test[2] test 2 50 return 'C'; 'C' return 'D'; 'D' return 'F'; 'F' int[] test test public class Main {
	
	public static void main(String[] args) {
		Main test = new Main();
		test.run();
	}
	

	
	//Data????¨??????\???????????\?????????
	private void run(){
		BufferedReader buf= new BufferedReader(new InputStreamReader(System.in));
		
		do {
			int[] linedata;
			try{
				linedata = changeTestdata(buf.readLine());
			}catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			}
			
			if (checkInputDataLast(linedata)) break;
			System.out.println(judgeData(linedata));
			
		}while(true);
	}
	
	private int[] changeTestdata(String line){
		String[] sdata = line.split(" ");
		
		int[] data = new int[sdata.length];
		for (int i = 0; i < sdata.length; i++){
			try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			}
		}
		
		return data;
	}
	
	private boolean checkInputDataLast(int[] data){
		if (data.length != 3) return false;
		return (data[0] == -1 &&data[1] == -1 &&data[2] == -1) ;
	}
	
	private char judgeData(int[] test){
		if (test.length < 2) return 'F';
		if (test[0] == -1 || test[1] == -1) return 'F';
		if (test[0] + test[1] >= 80) return'A';
		if (test[0] + test[1] >= 65) return 'B';
		if (test[0] + test[1] >= 50) return 'C';
		if (test[0] + test[1] >= 30){
			if (test[2] >= 50) return 'C';
			else return 'D';
		}
		
		return 'F';
	}
} public class Main {
	
	public static void main(String[] args) {
		Main test = new Main();
		test.run();
	}
	

	
	//Data????¨??????\???????????\?????????
	private void run(){
		BufferedReader buf= new BufferedReader(new InputStreamReader(System.in));
		
		do {
			int[] linedata;
			try{
				linedata = changeTestdata(buf.readLine());
			}catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			}
			
			if (checkInputDataLast(linedata)) break;
			System.out.println(judgeData(linedata));
			
		}while(true);
	}
	
	private int[] changeTestdata(String line){
		String[] sdata = line.split(" ");
		
		int[] data = new int[sdata.length];
		for (int i = 0; i < sdata.length; i++){
			try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			}
		}
		
		return data;
	}
	
	private boolean checkInputDataLast(int[] data){
		if (data.length != 3) return false;
		return (data[0] == -1 &&data[1] == -1 &&data[2] == -1) ;
	}
	
	private char judgeData(int[] test){
		if (test.length < 2) return 'F';
		if (test[0] == -1 || test[1] == -1) return 'F';
		if (test[0] + test[1] >= 80) return'A';
		if (test[0] + test[1] >= 65) return 'B';
		if (test[0] + test[1] >= 50) return 'C';
		if (test[0] + test[1] >= 30){
			if (test[2] >= 50) return 'C';
			else return 'D';
		}
		
		return 'F';
	}
} Main
//import java.util.ArrayList;
//import java.io.BufferedReader;
//import java.io.InputStreamReader;
//import java.io.IOException;
import java.io.*;
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Main test = new Main();
		test.run();
	}
	

	
	//Data????¨??????\???????????\?????????
	private void run(){
		BufferedReader buf= new BufferedReader(new InputStreamReader(System.in));
		
		do {
			int[] linedata;
			try{
				linedata = changeTestdata(buf.readLine());
			}catch(IOException e){
				System.err.println(e.toString());
				System.err.println("Input Error");
				continue;
			}
			
			if (checkInputDataLast(linedata)) break;
			System.out.println(judgeData(linedata));
			
		}while(true);
	}
	
	private int[] changeTestdata(String line){
		String[] sdata = line.split(" ");
		
		int[] data = new int[sdata.length];
		for (int i = 0; i < sdata.length; i++){
			try {
				data[i] = Integer.parseInt(sdata[i]);
			}catch(NumberFormatException e){
				data[i] = -2;
			}
		}
		
		return data;
	}
	
	private boolean checkInputDataLast(int[] data){
		if (data.length != 3) return false;
		return (data[0] == -1 &&data[1] == -1 &&data[2] == -1) ;
	}
	
	private char judgeData(int[] test){
		if (test.length < 2) return 'F';
		if (test[0] == -1 || test[1] == -1) return 'F';
		if (test[0] + test[1] >= 80) return'A';
		if (test[0] + test[1] >= 65) return 'B';
		if (test[0] + test[1] >= 50) return 'C';
		if (test[0] + test[1] >= 30){
			if (test[2] >= 50) return 'C';
			else return 'D';
		}
		
		return 'F';
	}
}