import java.util.*;
import java.lang.StringBuilder;
public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String[] st = new String[3];
		int[] n = new int[3];
		do{
			st = sc.nextLine().split(" ");
			for(int i = 0;i<st.length;i++){
				n[i] = Integer.parseInt(st[i]);
			}
			if(n[0]==-1&&n[1]==-1&&n[2]==-1){
				break;
			}else if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			}
		}while(true);
			System.out.print(sb);
	}
} import java.util.*; util.* java import java.lang.StringBuilder; StringBuilder java.lang public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String[] st = new String[3];
		int[] n = new int[3];
		do{
			st = sc.nextLine().split(" ");
			for(int i = 0;i<st.length;i++){
				n[i] = Integer.parseInt(st[i]);
			}
			if(n[0]==-1&&n[1]==-1&&n[2]==-1){
				break;
			}else if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			}
		}while(true);
			System.out.print(sb);
	}
} Main public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String[] st = new String[3];
		int[] n = new int[3];
		do{
			st = sc.nextLine().split(" ");
			for(int i = 0;i<st.length;i++){
				n[i] = Integer.parseInt(st[i]);
			}
			if(n[0]==-1&&n[1]==-1&&n[2]==-1){
				break;
			}else if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			}
		}while(true);
			System.out.print(sb);
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String[] st = new String[3];
		int[] n = new int[3];
		do{
			st = sc.nextLine().split(" ");
			for(int i = 0;i<st.length;i++){
				n[i] = Integer.parseInt(st[i]);
			}
			if(n[0]==-1&&n[1]==-1&&n[2]==-1){
				break;
			}else if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			}
		}while(true);
			System.out.print(sb);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String[] st = new String[3]; st new String[3] 3 int[] n = new int[3]; n new int[3] 3 do{
			st = sc.nextLine().split(" ");
			for(int i = 0;i<st.length;i++){
				n[i] = Integer.parseInt(st[i]);
			}
			if(n[0]==-1&&n[1]==-1&&n[2]==-1){
				break;
			}else if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			}
		}while(true); true {
			st = sc.nextLine().split(" ");
			for(int i = 0;i<st.length;i++){
				n[i] = Integer.parseInt(st[i]);
			}
			if(n[0]==-1&&n[1]==-1&&n[2]==-1){
				break;
			}else if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			}
		} st = sc.nextLine().split(" ") st sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " for(int i = 0;i<st.length;i++){
				n[i] = Integer.parseInt(st[i]);
			} int i = 0; int i = 0; i 0 i<st.length i st.length st st.length i++ i++ i {
				n[i] = Integer.parseInt(st[i]);
			} {
				n[i] = Integer.parseInt(st[i]);
			} n[i] = Integer.parseInt(st[i]) n[i] n i Integer.parseInt(st[i]) Integer.parseInt Integer st[i] st i if(n[0]==-1&&n[1]==-1&&n[2]==-1){
				break;
			}else if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			} n[0]==-1&&n[1]==-1&&n[2]==-1 n[0]==-1&&n[1]==-1&&n[2]==-1 n[0]==-1 n[0] n 0 -1 1 n[1]==-1 n[1] n 1 -1 1 n[2]==-1 n[2] n 2 -1 1 {
				break;
			} break; if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			} n[0]==-1||n[1]==-1 n[0]==-1 n[0] n 0 -1 1 n[1]==-1 n[1] n 1 -1 1 {
				sb.append("F\n");
			} sb.append("F\n") sb.append sb "F\n" if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			} n[0]+n[1]>=80 n[0]+n[1] n[0] n 0 n[1] n 1 80 {
				sb.append("A\n");
			} sb.append("A\n") sb.append sb "A\n" if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			} n[0]+n[1]>=65 n[0]+n[1] n[0] n 0 n[1] n 1 65 {
				sb.append("B\n");
			} sb.append("B\n") sb.append sb "B\n" if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			} n[0]+n[1]>=50 n[0]+n[1] n[0] n 0 n[1] n 1 50 {
				sb.append("C\n");
			} sb.append("C\n") sb.append sb "C\n" if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			} n[0]+n[1]>=30 n[0]+n[1] n[0] n 0 n[1] n 1 30 {
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			} if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				} n[2]>=50 n[2] n 2 50 {
					sb.append("C\n");
				} sb.append("C\n") sb.append sb "C\n" {
					sb.append("D\n");
				} sb.append("D\n") sb.append sb "D\n" {
				sb.append("F\n");
			} sb.append("F\n") sb.append sb "F\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String[] st = new String[3];
		int[] n = new int[3];
		do{
			st = sc.nextLine().split(" ");
			for(int i = 0;i<st.length;i++){
				n[i] = Integer.parseInt(st[i]);
			}
			if(n[0]==-1&&n[1]==-1&&n[2]==-1){
				break;
			}else if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			}
		}while(true);
			System.out.print(sb);
	}
} public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String[] st = new String[3];
		int[] n = new int[3];
		do{
			st = sc.nextLine().split(" ");
			for(int i = 0;i<st.length;i++){
				n[i] = Integer.parseInt(st[i]);
			}
			if(n[0]==-1&&n[1]==-1&&n[2]==-1){
				break;
			}else if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			}
		}while(true);
			System.out.print(sb);
	}
} Main
import java.util.*;
import java.lang.StringBuilder;
public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String[] st = new String[3];
		int[] n = new int[3];
		do{
			st = sc.nextLine().split(" ");
			for(int i = 0;i<st.length;i++){
				n[i] = Integer.parseInt(st[i]);
			}
			if(n[0]==-1&&n[1]==-1&&n[2]==-1){
				break;
			}else if(n[0]==-1||n[1]==-1){
				sb.append("F\n");
			}else if(n[0]+n[1]>=80){
				sb.append("A\n");
			}else if(n[0]+n[1]>=65){
				sb.append("B\n");
			}else if(n[0]+n[1]>=50){
				sb.append("C\n");
			}else if(n[0]+n[1]>=30){
				if(n[2]>=50){
					sb.append("C\n");
				}else{
					sb.append("D\n");
				}
			}else{
				sb.append("F\n");
			}
		}while(true);
			System.out.print(sb);
	}
}