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

public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		while(true){
			String[] input = br.readLine().split(" ");
			int m = Integer.parseInt(input[0]);
			int f = Integer.parseInt(input[1]);
			int r = Integer.parseInt(input[2]);

			if( m==-1 && f==-1 && r==-1 ) break;

			if( m==-1 || f==-1 || (m+f) < 30){
				sb.append("F\n");
			}else if( (m+f)>=30 && (m+f)<50 && r<50 ){
				sb.append("D\n");
			}else if( (m+f)>=30 && (m+f)<50 && r>=50 ){
				sb.append("C\n");
			}else if( (m+f)>=50 && (m+f)<65 ){
				sb.append("C\n");
			}else if( (m+f)>=65 && (m+f)<80 ){
				sb.append("B\n");
			}else if( (m+f)>=80 ){
				sb.append("A\n");
			}
		}

		System.out.print(sb);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		while(true){
			String[] input = br.readLine().split(" ");
			int m = Integer.parseInt(input[0]);
			int f = Integer.parseInt(input[1]);
			int r = Integer.parseInt(input[2]);

			if( m==-1 && f==-1 && r==-1 ) break;

			if( m==-1 || f==-1 || (m+f) < 30){
				sb.append("F\n");
			}else if( (m+f)>=30 && (m+f)<50 && r<50 ){
				sb.append("D\n");
			}else if( (m+f)>=30 && (m+f)<50 && r>=50 ){
				sb.append("C\n");
			}else if( (m+f)>=50 && (m+f)<65 ){
				sb.append("C\n");
			}else if( (m+f)>=65 && (m+f)<80 ){
				sb.append("B\n");
			}else if( (m+f)>=80 ){
				sb.append("A\n");
			}
		}

		System.out.print(sb);
	}
} Main public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		while(true){
			String[] input = br.readLine().split(" ");
			int m = Integer.parseInt(input[0]);
			int f = Integer.parseInt(input[1]);
			int r = Integer.parseInt(input[2]);

			if( m==-1 && f==-1 && r==-1 ) break;

			if( m==-1 || f==-1 || (m+f) < 30){
				sb.append("F\n");
			}else if( (m+f)>=30 && (m+f)<50 && r<50 ){
				sb.append("D\n");
			}else if( (m+f)>=30 && (m+f)<50 && r>=50 ){
				sb.append("C\n");
			}else if( (m+f)>=50 && (m+f)<65 ){
				sb.append("C\n");
			}else if( (m+f)>=65 && (m+f)<80 ){
				sb.append("B\n");
			}else if( (m+f)>=80 ){
				sb.append("A\n");
			}
		}

		System.out.print(sb);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		while(true){
			String[] input = br.readLine().split(" ");
			int m = Integer.parseInt(input[0]);
			int f = Integer.parseInt(input[1]);
			int r = Integer.parseInt(input[2]);

			if( m==-1 && f==-1 && r==-1 ) break;

			if( m==-1 || f==-1 || (m+f) < 30){
				sb.append("F\n");
			}else if( (m+f)>=30 && (m+f)<50 && r<50 ){
				sb.append("D\n");
			}else if( (m+f)>=30 && (m+f)<50 && r>=50 ){
				sb.append("C\n");
			}else if( (m+f)>=50 && (m+f)<65 ){
				sb.append("C\n");
			}else if( (m+f)>=65 && (m+f)<80 ){
				sb.append("B\n");
			}else if( (m+f)>=80 ){
				sb.append("A\n");
			}
		}

		System.out.print(sb);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuffer sb = new StringBuffer(); sb new StringBuffer() while(true){
			String[] input = br.readLine().split(" ");
			int m = Integer.parseInt(input[0]);
			int f = Integer.parseInt(input[1]);
			int r = Integer.parseInt(input[2]);

			if( m==-1 && f==-1 && r==-1 ) break;

			if( m==-1 || f==-1 || (m+f) < 30){
				sb.append("F\n");
			}else if( (m+f)>=30 && (m+f)<50 && r<50 ){
				sb.append("D\n");
			}else if( (m+f)>=30 && (m+f)<50 && r>=50 ){
				sb.append("C\n");
			}else if( (m+f)>=50 && (m+f)<65 ){
				sb.append("C\n");
			}else if( (m+f)>=65 && (m+f)<80 ){
				sb.append("B\n");
			}else if( (m+f)>=80 ){
				sb.append("A\n");
			}
		} true {
			String[] input = br.readLine().split(" ");
			int m = Integer.parseInt(input[0]);
			int f = Integer.parseInt(input[1]);
			int r = Integer.parseInt(input[2]);

			if( m==-1 && f==-1 && r==-1 ) break;

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

		while(true){
			String[] input = br.readLine().split(" ");
			int m = Integer.parseInt(input[0]);
			int f = Integer.parseInt(input[1]);
			int r = Integer.parseInt(input[2]);

			if( m==-1 && f==-1 && r==-1 ) break;

			if( m==-1 || f==-1 || (m+f) < 30){
				sb.append("F\n");
			}else if( (m+f)>=30 && (m+f)<50 && r<50 ){
				sb.append("D\n");
			}else if( (m+f)>=30 && (m+f)<50 && r>=50 ){
				sb.append("C\n");
			}else if( (m+f)>=50 && (m+f)<65 ){
				sb.append("C\n");
			}else if( (m+f)>=65 && (m+f)<80 ){
				sb.append("B\n");
			}else if( (m+f)>=80 ){
				sb.append("A\n");
			}
		}

		System.out.print(sb);
	}
} public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		while(true){
			String[] input = br.readLine().split(" ");
			int m = Integer.parseInt(input[0]);
			int f = Integer.parseInt(input[1]);
			int r = Integer.parseInt(input[2]);

			if( m==-1 && f==-1 && r==-1 ) break;

			if( m==-1 || f==-1 || (m+f) < 30){
				sb.append("F\n");
			}else if( (m+f)>=30 && (m+f)<50 && r<50 ){
				sb.append("D\n");
			}else if( (m+f)>=30 && (m+f)<50 && r>=50 ){
				sb.append("C\n");
			}else if( (m+f)>=50 && (m+f)<65 ){
				sb.append("C\n");
			}else if( (m+f)>=65 && (m+f)<80 ){
				sb.append("B\n");
			}else if( (m+f)>=80 ){
				sb.append("A\n");
			}
		}

		System.out.print(sb);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();

		while(true){
			String[] input = br.readLine().split(" ");
			int m = Integer.parseInt(input[0]);
			int f = Integer.parseInt(input[1]);
			int r = Integer.parseInt(input[2]);

			if( m==-1 && f==-1 && r==-1 ) break;

			if( m==-1 || f==-1 || (m+f) < 30){
				sb.append("F\n");
			}else if( (m+f)>=30 && (m+f)<50 && r<50 ){
				sb.append("D\n");
			}else if( (m+f)>=30 && (m+f)<50 && r>=50 ){
				sb.append("C\n");
			}else if( (m+f)>=50 && (m+f)<65 ){
				sb.append("C\n");
			}else if( (m+f)>=65 && (m+f)<80 ){
				sb.append("B\n");
			}else if( (m+f)>=80 ){
				sb.append("A\n");
			}
		}

		System.out.print(sb);
	}
}