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

public class Main{

	public static void main(String[] args) throws IOException
	{
		int m,f,r,sum;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );

		for(int i=0; i<255; i++)
		{
			String[] mfr = br.readLine().split(" ");
			m = Integer.parseInt(mfr[0]);
			f = Integer.parseInt(mfr[1]);
			r = Integer.parseInt(mfr[2]);

			sum = m+f;

			if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A");

		}
	}
} 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[] args) throws IOException
	{
		int m,f,r,sum;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );

		for(int i=0; i<255; i++)
		{
			String[] mfr = br.readLine().split(" ");
			m = Integer.parseInt(mfr[0]);
			f = Integer.parseInt(mfr[1]);
			r = Integer.parseInt(mfr[2]);

			sum = m+f;

			if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A");

		}
	}
} Main public static void main(String[] args) throws IOException
	{
		int m,f,r,sum;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );

		for(int i=0; i<255; i++)
		{
			String[] mfr = br.readLine().split(" ");
			m = Integer.parseInt(mfr[0]);
			f = Integer.parseInt(mfr[1]);
			r = Integer.parseInt(mfr[2]);

			sum = m+f;

			if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A");

		}
	} main {
		int m,f,r,sum;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );

		for(int i=0; i<255; i++)
		{
			String[] mfr = br.readLine().split(" ");
			m = Integer.parseInt(mfr[0]);
			f = Integer.parseInt(mfr[1]);
			r = Integer.parseInt(mfr[2]);

			sum = m+f;

			if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A");

		}
	} int m m f f r r sum; sum BufferedReader br = new BufferedReader(new InputStreamReader(System.in) ); br new BufferedReader(new InputStreamReader(System.in) ) for(int i=0; i<255; i++)
		{
			String[] mfr = br.readLine().split(" ");
			m = Integer.parseInt(mfr[0]);
			f = Integer.parseInt(mfr[1]);
			r = Integer.parseInt(mfr[2]);

			sum = m+f;

			if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A");

		} int i=0; int i=0; i 0 i<255 i 255 i++ i++ i {
			String[] mfr = br.readLine().split(" ");
			m = Integer.parseInt(mfr[0]);
			f = Integer.parseInt(mfr[1]);
			r = Integer.parseInt(mfr[2]);

			sum = m+f;

			if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A");

		} {
			String[] mfr = br.readLine().split(" ");
			m = Integer.parseInt(mfr[0]);
			f = Integer.parseInt(mfr[1]);
			r = Integer.parseInt(mfr[2]);

			sum = m+f;

			if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A");

		} String[] mfr = br.readLine().split(" "); mfr br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " m = Integer.parseInt(mfr[0]) m Integer.parseInt(mfr[0]) Integer.parseInt Integer mfr[0] mfr 0 f = Integer.parseInt(mfr[1]) f Integer.parseInt(mfr[1]) Integer.parseInt Integer mfr[1] mfr 1 r = Integer.parseInt(mfr[2]) r Integer.parseInt(mfr[2]) Integer.parseInt Integer mfr[2] mfr 2 sum = m+f sum m+f m f if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A"); sum+r == -3 sum+r sum r -3 3 break; if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A"); m*f < 0 || sum < 30 m*f < 0 m*f m f 0 sum < 30 sum 30 System.out.println("F") System.out.println System.out System System.out "F" if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A"); 30 <= sum && sum < 50 30 <= sum 30 sum sum < 50 sum 50 System.out.println( (50 <= r) ? 'C' : 'D') System.out.println System.out System System.out (50 <= r) ? 'C' : 'D' (50 <= r) 50 r 'C' 'D' if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A"); 50 <= sum && sum < 65 50 <= sum 50 sum sum < 65 sum 65 System.out.println("C") System.out.println System.out System System.out "C" if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A"); 65 <= sum && sum < 80 65 <= sum 65 sum sum < 80 sum 80 System.out.println("B") System.out.println System.out System System.out "B" if(80 <= sum ) System.out.println("A"); 80 <= sum 80 sum 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) throws IOException
	{
		int m,f,r,sum;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );

		for(int i=0; i<255; i++)
		{
			String[] mfr = br.readLine().split(" ");
			m = Integer.parseInt(mfr[0]);
			f = Integer.parseInt(mfr[1]);
			r = Integer.parseInt(mfr[2]);

			sum = m+f;

			if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A");

		}
	}
} public class Main{

	public static void main(String[] args) throws IOException
	{
		int m,f,r,sum;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );

		for(int i=0; i<255; i++)
		{
			String[] mfr = br.readLine().split(" ");
			m = Integer.parseInt(mfr[0]);
			f = Integer.parseInt(mfr[1]);
			r = Integer.parseInt(mfr[2]);

			sum = m+f;

			if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A");

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

public class Main{

	public static void main(String[] args) throws IOException
	{
		int m,f,r,sum;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );

		for(int i=0; i<255; i++)
		{
			String[] mfr = br.readLine().split(" ");
			m = Integer.parseInt(mfr[0]);
			f = Integer.parseInt(mfr[1]);
			r = Integer.parseInt(mfr[2]);

			sum = m+f;

			if(sum+r == -3)  break;

			else if(m*f < 0 || sum < 30) System.out.println("F");

			else if(30 <= sum && sum < 50) System.out.println( (50 <= r) ? 'C' : 'D');

			else if(50 <= sum && sum < 65) System.out.println("C");

			else if(65 <= sum && sum < 80) System.out.println("B");

			else if(80 <= sum ) System.out.println("A");

		}
	}
}