import java.util.*;
public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int a, b, c;
		while(true)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			if(a == -1  && b == -1 && c == -1)
				break;
			else {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			}
		}
	}
} import java.util.*; util.* java public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int a, b, c;
		while(true)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			if(a == -1  && b == -1 && c == -1)
				break;
			else {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			}
		}
	}
} Main public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int a, b, c;
		while(true)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			if(a == -1  && b == -1 && c == -1)
				break;
			else {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			}
		}
	} main {
		Scanner input = new Scanner(System.in);
		int a, b, c;
		while(true)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			if(a == -1  && b == -1 && c == -1)
				break;
			else {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			}
		}
	} Scanner input = new Scanner(System.in); input new Scanner(System.in) int a a b b c; c while(true)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			if(a == -1  && b == -1 && c == -1)
				break;
			else {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			}
		} true {
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			if(a == -1  && b == -1 && c == -1)
				break;
			else {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			}
		} a = input.nextInt() a input.nextInt() input.nextInt input b = input.nextInt() b input.nextInt() input.nextInt input c = input.nextInt() c input.nextInt() input.nextInt input if(a == -1  && b == -1 && c == -1)
				break;
			else {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			} a == -1  && b == -1 && c == -1 a == -1  && b == -1 && c == -1 a == -1 a -1 1 b == -1 b -1 1 c == -1 c -1 1 break; {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			} if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A"); a == -1 || b == -1 a == -1 a -1 1 b == -1 b -1 1 System.out.println("F") System.out.println System.out System System.out "F" if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A"); a+b < 30 a+b a b 30 System.out.println("F") System.out.println System.out System System.out "F" if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A"); a+b < 50 a+b a b 50 {
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				} if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					} c == -1 c -1 1 {
						System.out.println("D");
					} System.out.println("D") System.out.println System.out System System.out "D" {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					} if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D"); c >= 50 c 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" if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A"); a+b < 65 a+b a b 65 System.out.println("C") System.out.println System.out System System.out "C" if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A"); a+b < 80 a+b a b 80 System.out.println("B") System.out.println System.out System System.out "B" if(a+b >= 80)
					System.out.println("A"); a+b >= 80 a+b a b 80 System.out.println("A") System.out.println System.out System System.out "A" String args[] args public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int a, b, c;
		while(true)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			if(a == -1  && b == -1 && c == -1)
				break;
			else {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			}
		}
	}
} public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int a, b, c;
		while(true)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			if(a == -1  && b == -1 && c == -1)
				break;
			else {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			}
		}
	}
} Main
import java.util.*;
public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int a, b, c;
		while(true)
		{
			a = input.nextInt();
			b = input.nextInt();
			c = input.nextInt();
			if(a == -1  && b == -1 && c == -1)
				break;
			else {
				if(a == -1 || b == -1)
					System.out.println("F");
				else if(a+b < 30)
					System.out.println("F");
				else if(a+b < 50){
					if(c == -1){
						System.out.println("D");
					}
					else {
						if(c >= 50)
							System.out.println("C");
						else
							System.out.println("D");
					}
				}
				else if(a+b < 65)
					System.out.println("C");
				else if(a+b < 80)
					System.out.println("B");
			
				else if(a+b >= 80)
					System.out.println("A");
			}
		}
	}
}