import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);

		boolean isContinue = true;

		//?????°???????´?????????????
		int[] score = new int[3];
		//????????????????´????????????¬????????§????????????
		ArrayList<String> list = new ArrayList<String>();

		while(isContinue){

			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();


			int intScore = 0;
			//????????????????????´??????intScore????¨????
			if(m != -1 && f != -1){
				intScore = m + f;
			}

			//while????????????????????¶
			if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			}
			//System.out.println("list.size():" + list.size());
		}

		for(int i = 0; i < list.size(); i++){

			System.out.println(list.get(i));
		}

	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);

		boolean isContinue = true;

		//?????°???????´?????????????
		int[] score = new int[3];
		//????????????????´????????????¬????????§????????????
		ArrayList<String> list = new ArrayList<String>();

		while(isContinue){

			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();


			int intScore = 0;
			//????????????????????´??????intScore????¨????
			if(m != -1 && f != -1){
				intScore = m + f;
			}

			//while????????????????????¶
			if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			}
			//System.out.println("list.size():" + list.size());
		}

		for(int i = 0; i < list.size(); i++){

			System.out.println(list.get(i));
		}

	}
} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);

		boolean isContinue = true;

		//?????°???????´?????????????
		int[] score = new int[3];
		//????????????????´????????????¬????????§????????????
		ArrayList<String> list = new ArrayList<String>();

		while(isContinue){

			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();


			int intScore = 0;
			//????????????????????´??????intScore????¨????
			if(m != -1 && f != -1){
				intScore = m + f;
			}

			//while????????????????????¶
			if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			}
			//System.out.println("list.size():" + list.size());
		}

		for(int i = 0; i < list.size(); i++){

			System.out.println(list.get(i));
		}

	} main {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);

		boolean isContinue = true;

		//?????°???????´?????????????
		int[] score = new int[3];
		//????????????????´????????????¬????????§????????????
		ArrayList<String> list = new ArrayList<String>();

		while(isContinue){

			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();


			int intScore = 0;
			//????????????????????´??????intScore????¨????
			if(m != -1 && f != -1){
				intScore = m + f;
			}

			//while????????????????????¶
			if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			}
			//System.out.println("list.size():" + list.size());
		}

		for(int i = 0; i < list.size(); i++){

			System.out.println(list.get(i));
		}

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) boolean isContinue = true; isContinue true int[] score = new int[3]; score new int[3] 3 ArrayList<String> list = new ArrayList<String>(); list new ArrayList<String>() while(isContinue){

			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();


			int intScore = 0;
			//????????????????????´??????intScore????¨????
			if(m != -1 && f != -1){
				intScore = m + f;
			}

			//while????????????????????¶
			if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			}
			//System.out.println("list.size():" + list.size());
		} isContinue {

			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();


			int intScore = 0;
			//????????????????????´??????intScore????¨????
			if(m != -1 && f != -1){
				intScore = m + f;
			}

			//while????????????????????¶
			if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			}
			//System.out.println("list.size():" + list.size());
		} int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int f = scan.nextInt(); f scan.nextInt() scan.nextInt scan int r = scan.nextInt(); r scan.nextInt() scan.nextInt scan int intScore = 0; intScore 0 if(m != -1 && f != -1){
				intScore = m + f;
			} m != -1 && f != -1 m != -1 m -1 1 f != -1 f -1 1 {
				intScore = m + f;
			} intScore = m + f intScore m + f m f if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			} 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 {
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			} isContinue = false isContinue false scan.close() scan.close scan if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			} m == -1 || f == -1 || intScore < 30 m == -1 || f == -1 || intScore < 30 m == -1 m -1 1 f == -1 f -1 1 intScore < 30 intScore 30 {

				list.add("F");
			} list.add("F") list.add list "F" if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			} 80 <= intScore 80 intScore {

				list.add("A");
			} list.add("A") list.add list "A" if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			} 65 <= intScore 65 intScore {

				list.add("B");
			} list.add("B") list.add list "B" if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			} 50 <= intScore 50 intScore {

				list.add("C");
			} list.add("C") list.add list "C" if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			} 30 <= intScore &&  50 <= r 30 <= intScore 30 intScore 50 <= r 50 r {

				list.add("C");

			} list.add("C") list.add list "C" {

				list.add("D");
			} list.add("D") list.add list "D" for(int i = 0; i < list.size(); i++){

			System.out.println(list.get(i));
		} int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {

			System.out.println(list.get(i));
		} {

			System.out.println(list.get(i));
		} System.out.println(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);

		boolean isContinue = true;

		//?????°???????´?????????????
		int[] score = new int[3];
		//????????????????´????????????¬????????§????????????
		ArrayList<String> list = new ArrayList<String>();

		while(isContinue){

			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();


			int intScore = 0;
			//????????????????????´??????intScore????¨????
			if(m != -1 && f != -1){
				intScore = m + f;
			}

			//while????????????????????¶
			if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			}
			//System.out.println("list.size():" + list.size());
		}

		for(int i = 0; i < list.size(); i++){

			System.out.println(list.get(i));
		}

	}
} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);

		boolean isContinue = true;

		//?????°???????´?????????????
		int[] score = new int[3];
		//????????????????´????????????¬????????§????????????
		ArrayList<String> list = new ArrayList<String>();

		while(isContinue){

			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();


			int intScore = 0;
			//????????????????????´??????intScore????¨????
			if(m != -1 && f != -1){
				intScore = m + f;
			}

			//while????????????????????¶
			if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			}
			//System.out.println("list.size():" + list.size());
		}

		for(int i = 0; i < list.size(); i++){

			System.out.println(list.get(i));
		}

	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner scan = new Scanner(System.in);

		boolean isContinue = true;

		//?????°???????´?????????????
		int[] score = new int[3];
		//????????????????´????????????¬????????§????????????
		ArrayList<String> list = new ArrayList<String>();

		while(isContinue){

			int m = scan.nextInt();
			int f = scan.nextInt();
			int r = scan.nextInt();


			int intScore = 0;
			//????????????????????´??????intScore????¨????
			if(m != -1 && f != -1){
				intScore = m + f;
			}

			//while????????????????????¶
			if(m == -1 && f == -1 && r == -1){
				isContinue = false;
				scan.close();

			//????????????????????????????????????list???????´?
			}else if(m == -1 || f == -1 || intScore < 30 ){

				list.add("F");
			}else if(80 <= intScore){

				list.add("A");
			}else if(65 <= intScore){

				list.add("B");
			}else if(50 <= intScore){

				list.add("C");
			}else if(30 <= intScore &&  50 <= r){

				list.add("C");

			}else{

				list.add("D");
			}
			//System.out.println("list.size():" + list.size());
		}

		for(int i = 0; i < list.size(); i++){

			System.out.println(list.get(i));
		}

	}
}