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

public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String buffer[] = new String[3];
		int array[] = new int[3];
		String ans;

		while(true){


			try {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}

 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 final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String buffer[] = new String[3];
		int array[] = new int[3];
		String ans;

		while(true){


			try {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
} Main public static final int BIG_NUM  = 2000000000; BIG_NUM 2000000000 public static final int MOD  = 1000000007; MOD 1000000007 public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String buffer[] = new String[3];
		int array[] = new int[3];
		String ans;

		while(true){


			try {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String buffer[] = new String[3];
		int array[] = new int[3];
		String ans;

		while(true){


			try {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String buffer[] = new String[3]; buffer new String[3] 3 int array[] = new int[3]; array new int[3] 3 String ans; ans while(true){


			try {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} catch (IOException e) {
				e.printStackTrace();
			}
		} true {


			try {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} catch (IOException e) {
				e.printStackTrace();
			}
		} try {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} catch (IOException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			} IOException e {
				e.printStackTrace();
			} e.printStackTrace() e.printStackTrace e {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} buffer = br.readLine().split("\\s+") buffer br.readLine().split("\\s+") br.readLine().split br.readLine() br.readLine br "\\s+" for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				} int i = 0; int i = 0; i 0 i < buffer.length i buffer.length buffer buffer.length i++ i++ i {
					array[i] = Integer.parseInt(buffer[i]);
				} {
					array[i] = Integer.parseInt(buffer[i]);
				} array[i] = Integer.parseInt(buffer[i]) array[i] array i Integer.parseInt(buffer[i]) Integer.parseInt Integer buffer[i] buffer i if(array[0] == -1 && array[1] == -1 && array[2] == -1)break; array[0] == -1 && array[1] == -1 && array[2] == -1 array[0] == -1 && array[1] == -1 && array[2] == -1 array[0] == -1 array[0] array 0 -1 1 array[1] == -1 array[1] array 1 -1 1 array[2] == -1 array[2] array 2 -1 1 break; if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				} array[0] == -1 || array[1] == -1 array[0] == -1 array[0] array 0 -1 1 array[1] == -1 array[1] array 1 -1 1 {
					ans = "F";
				} ans = "F" ans "F" if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				} array[0]+array[1] >= 80 array[0]+array[1] array[0] array 0 array[1] array 1 80 {
					ans = "A";
				} ans = "A" ans "A" if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				} array[0]+array[1] >= 65 array[0]+array[1] array[0] array 0 array[1] array 1 65 {
					ans = "B";
				} ans = "B" ans "B" if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				} array[0]+array[1] >= 50 array[0]+array[1] array[0] array 0 array[1] array 1 50 {
					ans = "C";
				} ans = "C" ans "C" if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				} array[0]+array[1] >= 30 array[0]+array[1] array[0] array 0 array[1] array 1 30 {
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				} if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					} array[2] >= 50 array[2] array 2 50 {
						ans = "C";
					} ans = "C" ans "C" {
						ans = "D";
					} ans = "D" ans "D" {
					ans = "F";
				} ans = "F" ans "F" System.out.printf("%s\n", ans) System.out.printf System.out System System.out "%s\n" ans String[] args args public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String buffer[] = new String[3];
		int array[] = new int[3];
		String ans;

		while(true){


			try {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
} public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String buffer[] = new String[3];
		int array[] = new int[3];
		String ans;

		while(true){


			try {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String buffer[] = new String[3];
		int array[] = new int[3];
		String ans;

		while(true){


			try {
				buffer = br.readLine().split("\\s+");
				for(int i = 0; i < buffer.length; i++){
					array[i] = Integer.parseInt(buffer[i]);
				}
				if(array[0] == -1 && array[1] == -1 && array[2] == -1)break;

				if(array[0] == -1 || array[1] == -1){
					ans = "F";
				}else if(array[0]+array[1] >= 80){
					ans = "A";
				}else if(array[0]+array[1] >= 65){
					ans = "B";
				}else if(array[0]+array[1] >= 50){
					ans = "C";
				}else if(array[0]+array[1] >= 30){
					if(array[2] >= 50){
						ans = "C";
					}else{
						ans = "D";
					}
				}else{
					ans = "F";
				}

				System.out.printf("%s\n", ans);

			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}


