import java.util.Scanner;



public class Main {
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		for(;;)
		{	
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			int sum = m + f;
			String result = "";
			if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			}
			
			System.out.println(result);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		for(;;)
		{	
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			int sum = m + f;
			String result = "";
			if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			}
			
			System.out.println(result);
		}
	}
} Main public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		for(;;)
		{	
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			int sum = m + f;
			String result = "";
			if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			}
			
			System.out.println(result);
		}
	} main {
		Scanner scanner = new Scanner(System.in);
		
		for(;;)
		{	
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			int sum = m + f;
			String result = "";
			if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			}
			
			System.out.println(result);
		}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) for(;;)
		{	
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			int sum = m + f;
			String result = "";
			if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			}
			
			System.out.println(result);
		} ; {	
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			int sum = m + f;
			String result = "";
			if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			}
			
			System.out.println(result);
		} {	
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			int sum = m + f;
			String result = "";
			if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			}
			
			System.out.println(result);
		} int m = scanner.nextInt(); m scanner.nextInt() scanner.nextInt scanner int f = scanner.nextInt(); f scanner.nextInt() scanner.nextInt scanner int r = scanner.nextInt(); r scanner.nextInt() scanner.nextInt scanner int sum = m + f; sum m + f m f String result = ""; result "" if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			} 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;
			} break; if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			} m==-1 || f==-1 m==-1 m -1 1 f==-1 f -1 1 {
				result = "F";
			} result = "F" result "F" if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			} sum < 30 sum 30 {
				result = "F";
			} result = "F" result "F" if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			} 30<=sum && sum < 50 30<=sum 30 sum sum < 50 sum 50 {
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			} if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				} r >= 50 r 50 {
					result = "C";
				} result = "C" result "C" {
					result = "D";
				} result = "D" result "D" if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			} 50<=sum && sum < 65 50<=sum 50 sum sum < 65 sum 65 {
				result = "C";
			} result = "C" result "C" if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			} 65<=sum && sum < 80 65<=sum 65 sum sum < 80 sum 80 {
				result = "B";
			} result = "B" result "B" {
				result = "A";
			} result = "A" result "A" System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		for(;;)
		{	
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			int sum = m + f;
			String result = "";
			if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			}
			
			System.out.println(result);
		}
	}
} public class Main {
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		for(;;)
		{	
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			int sum = m + f;
			String result = "";
			if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			}
			
			System.out.println(result);
		}
	}
} Main
import java.util.Scanner;



public class Main {
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		for(;;)
		{	
			int m = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			
			int sum = m + f;
			String result = "";
			if(m==-1 && f==-1 && r==-1)
			{
				break;
			}
			else if(m==-1 || f==-1)
			{
				result = "F";
			}
			else if(sum < 30)
			{
				result = "F";
			}
			else if(30<=sum && sum < 50)
			{
				if(r >= 50)
				{
					result = "C";
				}
				else
				{
					result = "D";
				}
			}
			else if(50<=sum && sum < 65)
			{
				result = "C";
			}
			else if(65<=sum && sum < 80)
			{
				result = "B";
			}
			else {
				result = "A";
			}
			
			System.out.println(result);
		}
	}
}