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,i;
		char cRank[] = new char[256];

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

		for(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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A';

		}

		br.close();

		for(int n=0; n<i; n++) System.out.println(cRank[n]);
	}
} 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,i;
		char cRank[] = new char[256];

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

		for(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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A';

		}

		br.close();

		for(int n=0; n<i; n++) System.out.println(cRank[n]);
	}
} Main public static void main(String[] args) throws IOException
	{
		int m,f,r,sum,i;
		char cRank[] = new char[256];

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

		for(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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A';

		}

		br.close();

		for(int n=0; n<i; n++) System.out.println(cRank[n]);
	} main {
		int m,f,r,sum,i;
		char cRank[] = new char[256];

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

		for(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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A';

		}

		br.close();

		for(int n=0; n<i; n++) System.out.println(cRank[n]);
	} int m m f f r r sum sum i; i char cRank[] = new char[256]; cRank new char[256] 256 BufferedReader br = new BufferedReader(new InputStreamReader(System.in) ); br new BufferedReader(new InputStreamReader(System.in) ) for(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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A';

		} i=0; 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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = '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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = '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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A'; sum+r == -3 sum+r sum r -3 3 break; if(m*f < 0 || sum < 30) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A'; m*f < 0 || sum < 30 m*f < 0 m*f m f 0 sum < 30 sum 30 cRank[i] = 'F' cRank[i] cRank i 'F' if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A'; 30 <= sum && sum < 50 30 <= sum 30 sum sum < 50 sum 50 cRank[i] = (50 <= r)? 'C' : 'D' cRank[i] cRank i (50 <= r)? 'C' : 'D' (50 <= r) 50 r 'C' 'D' if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A'; 50 <= sum && sum < 65 50 <= sum 50 sum sum < 65 sum 65 cRank[i] = 'C' cRank[i] cRank i 'C' if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A'; 65 <= sum && sum < 80 65 <= sum 65 sum sum < 80 sum 80 cRank[i] = 'B' cRank[i] cRank i 'B' if(80 <= sum ) cRank[i] = 'A'; 80 <= sum 80 sum cRank[i] = 'A' cRank[i] cRank i 'A' br.close() br.close br for(int n=0; n<i; n++) System.out.println(cRank[n]); int n=0; int n=0; n 0 n<i n i n++ n++ n System.out.println(cRank[n]); System.out.println(cRank[n]) System.out.println System.out System System.out cRank[n] cRank n String[] args args public class Main{

	public static void main(String[] args) throws IOException
	{
		int m,f,r,sum,i;
		char cRank[] = new char[256];

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

		for(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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A';

		}

		br.close();

		for(int n=0; n<i; n++) System.out.println(cRank[n]);
	}
} public class Main{

	public static void main(String[] args) throws IOException
	{
		int m,f,r,sum,i;
		char cRank[] = new char[256];

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

		for(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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A';

		}

		br.close();

		for(int n=0; n<i; n++) System.out.println(cRank[n]);
	}
} 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,i;
		char cRank[] = new char[256];

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

		for(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) cRank[i] = 'F';

			else if(30 <= sum && sum < 50) cRank[i] = (50 <= r)? 'C' : 'D';

			else if(50 <= sum && sum < 65) cRank[i] = 'C';

			else if(65 <= sum && sum < 80) cRank[i] = 'B';

			else if(80 <= sum ) cRank[i] = 'A';

		}

		br.close();

		for(int n=0; n<i; n++) System.out.println(cRank[n]);
	}
}