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

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int m;
		int f;
		int r;
		ArrayList<String> list = new ArrayList<String>();
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m == -1 || f == -1){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			}
		}
		for(int i = 0; i < list.size(); i++){
			System.out.println(list.get(i));
		}

		scan.close();
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int m;
		int f;
		int r;
		ArrayList<String> list = new ArrayList<String>();
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m == -1 || f == -1){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			}
		}
		for(int i = 0; i < list.size(); i++){
			System.out.println(list.get(i));
		}

		scan.close();
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int m;
		int f;
		int r;
		ArrayList<String> list = new ArrayList<String>();
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m == -1 || f == -1){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			}
		}
		for(int i = 0; i < list.size(); i++){
			System.out.println(list.get(i));
		}

		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int m;
		int f;
		int r;
		ArrayList<String> list = new ArrayList<String>();
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m == -1 || f == -1){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			}
		}
		for(int i = 0; i < list.size(); i++){
			System.out.println(list.get(i));
		}

		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int m; m int f; f int r; r ArrayList<String> list = new ArrayList<String>(); list new ArrayList<String>() while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m == -1 || f == -1){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			}
		} true {
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m == -1 || f == -1){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			}
		} m = scan.nextInt() m scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m == -1 || f == -1){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			} 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){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
				list.add("F");
			} list.add("F") list.add list "F" if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			} 80 <= m + f 80 m + f m f {
				list.add("A");
			} list.add("A") list.add list "A" if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			} 65 <= m + f 65 m + f m f {
				list.add("B");
			} list.add("B") list.add list "B" if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			} 50 <= m + f 50 m + f m f {
				list.add("C");
			} list.add("C") list.add list "C" if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			} 30 <= m + f 30 m + f m f {
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			} if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				} 50 <= r 50 r {
					list.add("C");
				} list.add("C") list.add list "C" {
					list.add("D");
				} list.add("D") list.add list "D" {
				list.add("F");
			} list.add("F") list.add list "F" 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 scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int m;
		int f;
		int r;
		ArrayList<String> list = new ArrayList<String>();
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m == -1 || f == -1){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			}
		}
		for(int i = 0; i < list.size(); i++){
			System.out.println(list.get(i));
		}

		scan.close();
	}
} public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int m;
		int f;
		int r;
		ArrayList<String> list = new ArrayList<String>();
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m == -1 || f == -1){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			}
		}
		for(int i = 0; i < list.size(); i++){
			System.out.println(list.get(i));
		}

		scan.close();
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int m;
		int f;
		int r;
		ArrayList<String> list = new ArrayList<String>();
		while(true){
			m = scan.nextInt();
			f = scan.nextInt();
			r = scan.nextInt();
			if(m == -1 && f == -1 && r == -1){
				break;
			}else if(m == -1 || f == -1){
				list.add("F");
			}else if(80 <= m + f){
				list.add("A");
			}else if(65 <= m + f){
				list.add("B");
			}else if(50 <= m + f){
				list.add("C");
			}else if(30 <= m + f){
				if(50 <= r){
					list.add("C");
				}else{
					list.add("D");
				}
			}else{
				list.add("F");
			}
		}
		for(int i = 0; i < list.size(); i++){
			System.out.println(list.get(i));
		}

		scan.close();
	}
}