import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int sum;
		int score[] = new int[3];

		score[0] = sc.nextInt();
		score[1] = sc.nextInt();
		score[2] = sc.nextInt();

		while(score[0] != -1 || score[1] != -1 || score[2] != -1){
			sum = score[0] + score[1];

			if(score[0] == -1 || score[1] == -1){
				System.out.println("F");
			}else if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			}

			score[0] = sc.nextInt();
			score[1] = sc.nextInt();
			score[2] = sc.nextInt();
		}
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int sum;
		int score[] = new int[3];

		score[0] = sc.nextInt();
		score[1] = sc.nextInt();
		score[2] = sc.nextInt();

		while(score[0] != -1 || score[1] != -1 || score[2] != -1){
			sum = score[0] + score[1];

			if(score[0] == -1 || score[1] == -1){
				System.out.println("F");
			}else if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			}

			score[0] = sc.nextInt();
			score[1] = sc.nextInt();
			score[2] = sc.nextInt();
		}
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int sum;
		int score[] = new int[3];

		score[0] = sc.nextInt();
		score[1] = sc.nextInt();
		score[2] = sc.nextInt();

		while(score[0] != -1 || score[1] != -1 || score[2] != -1){
			sum = score[0] + score[1];

			if(score[0] == -1 || score[1] == -1){
				System.out.println("F");
			}else if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			}

			score[0] = sc.nextInt();
			score[1] = sc.nextInt();
			score[2] = sc.nextInt();
		}
	} main {
		Scanner sc = new Scanner(System.in);

		int sum;
		int score[] = new int[3];

		score[0] = sc.nextInt();
		score[1] = sc.nextInt();
		score[2] = sc.nextInt();

		while(score[0] != -1 || score[1] != -1 || score[2] != -1){
			sum = score[0] + score[1];

			if(score[0] == -1 || score[1] == -1){
				System.out.println("F");
			}else if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			}

			score[0] = sc.nextInt();
			score[1] = sc.nextInt();
			score[2] = sc.nextInt();
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int sum; sum int score[] = new int[3]; score new int[3] 3 score[0] = sc.nextInt() score[0] score 0 sc.nextInt() sc.nextInt sc score[1] = sc.nextInt() score[1] score 1 sc.nextInt() sc.nextInt sc score[2] = sc.nextInt() score[2] score 2 sc.nextInt() sc.nextInt sc while(score[0] != -1 || score[1] != -1 || score[2] != -1){
			sum = score[0] + score[1];

			if(score[0] == -1 || score[1] == -1){
				System.out.println("F");
			}else if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			}

			score[0] = sc.nextInt();
			score[1] = sc.nextInt();
			score[2] = sc.nextInt();
		} score[0] != -1 || score[1] != -1 || score[2] != -1 score[0] != -1 || score[1] != -1 || score[2] != -1 score[0] != -1 score[0] score 0 -1 1 score[1] != -1 score[1] score 1 -1 1 score[2] != -1 score[2] score 2 -1 1 {
			sum = score[0] + score[1];

			if(score[0] == -1 || score[1] == -1){
				System.out.println("F");
			}else if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			}

			score[0] = sc.nextInt();
			score[1] = sc.nextInt();
			score[2] = sc.nextInt();
		} sum = score[0] + score[1] sum score[0] + score[1] score[0] score 0 score[1] score 1 if(score[0] == -1 || score[1] == -1){
				System.out.println("F");
			}else if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			} score[0] == -1 || score[1] == -1 score[0] == -1 score[0] score 0 -1 1 score[1] == -1 score[1] score 1 -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			} sum >= 80 sum 80 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			} sum >= 65 sum 65 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			} sum >= 50 sum 50 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			} sum >= 30 sum 30 {
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			} if(score[2] >= 50) System.out.println("C");
				else System.out.println("D"); score[2] >= 50 score[2] score 2 50 System.out.println("C") System.out.println System.out System System.out "C" 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" score[0] = sc.nextInt() score[0] score 0 sc.nextInt() sc.nextInt sc score[1] = sc.nextInt() score[1] score 1 sc.nextInt() sc.nextInt sc score[2] = sc.nextInt() score[2] score 2 sc.nextInt() sc.nextInt sc String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int sum;
		int score[] = new int[3];

		score[0] = sc.nextInt();
		score[1] = sc.nextInt();
		score[2] = sc.nextInt();

		while(score[0] != -1 || score[1] != -1 || score[2] != -1){
			sum = score[0] + score[1];

			if(score[0] == -1 || score[1] == -1){
				System.out.println("F");
			}else if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			}

			score[0] = sc.nextInt();
			score[1] = sc.nextInt();
			score[2] = sc.nextInt();
		}
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int sum;
		int score[] = new int[3];

		score[0] = sc.nextInt();
		score[1] = sc.nextInt();
		score[2] = sc.nextInt();

		while(score[0] != -1 || score[1] != -1 || score[2] != -1){
			sum = score[0] + score[1];

			if(score[0] == -1 || score[1] == -1){
				System.out.println("F");
			}else if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			}

			score[0] = sc.nextInt();
			score[1] = sc.nextInt();
			score[2] = sc.nextInt();
		}
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int sum;
		int score[] = new int[3];

		score[0] = sc.nextInt();
		score[1] = sc.nextInt();
		score[2] = sc.nextInt();

		while(score[0] != -1 || score[1] != -1 || score[2] != -1){
			sum = score[0] + score[1];

			if(score[0] == -1 || score[1] == -1){
				System.out.println("F");
			}else if(sum >= 80){
				System.out.println("A");
			}else if(sum >= 65){
				System.out.println("B");
			}else if(sum >= 50){
				System.out.println("C");
			}else if(sum >= 30){
				if(score[2] >= 50) System.out.println("C");
				else System.out.println("D");
			}else{
				System.out.println("F");
			}

			score[0] = sc.nextInt();
			score[1] = sc.nextInt();
			score[2] = sc.nextInt();
		}
	}
}
