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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintStream out = System.out;
		int m, f, r;
		while(true){
			String[] score = in.readLine().split(" ");
			m = Integer.parseInt(score[0]);
			f = Integer.parseInt(score[1]);
			r = Integer.parseInt(score[2]);
			if(m==-1 && f==-1 && r==-1){
				break;
			}
			if(m==-1 || f==-1){
				out.println("F");
			}else if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			}
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintStream; PrintStream java.io public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintStream out = System.out;
		int m, f, r;
		while(true){
			String[] score = in.readLine().split(" ");
			m = Integer.parseInt(score[0]);
			f = Integer.parseInt(score[1]);
			r = Integer.parseInt(score[2]);
			if(m==-1 && f==-1 && r==-1){
				break;
			}
			if(m==-1 || f==-1){
				out.println("F");
			}else if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			}
		}
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintStream out = System.out;
		int m, f, r;
		while(true){
			String[] score = in.readLine().split(" ");
			m = Integer.parseInt(score[0]);
			f = Integer.parseInt(score[1]);
			r = Integer.parseInt(score[2]);
			if(m==-1 && f==-1 && r==-1){
				break;
			}
			if(m==-1 || f==-1){
				out.println("F");
			}else if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			}
		}
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintStream out = System.out;
		int m, f, r;
		while(true){
			String[] score = in.readLine().split(" ");
			m = Integer.parseInt(score[0]);
			f = Integer.parseInt(score[1]);
			r = Integer.parseInt(score[2]);
			if(m==-1 && f==-1 && r==-1){
				break;
			}
			if(m==-1 || f==-1){
				out.println("F");
			}else if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			}
		}
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) PrintStream out = System.out; out System.out System System.out int m m f f r; r while(true){
			String[] score = in.readLine().split(" ");
			m = Integer.parseInt(score[0]);
			f = Integer.parseInt(score[1]);
			r = Integer.parseInt(score[2]);
			if(m==-1 && f==-1 && r==-1){
				break;
			}
			if(m==-1 || f==-1){
				out.println("F");
			}else if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			}
		} true {
			String[] score = in.readLine().split(" ");
			m = Integer.parseInt(score[0]);
			f = Integer.parseInt(score[1]);
			r = Integer.parseInt(score[2]);
			if(m==-1 && f==-1 && r==-1){
				break;
			}
			if(m==-1 || f==-1){
				out.println("F");
			}else if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			}
		} String[] score = in.readLine().split(" "); score in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " m = Integer.parseInt(score[0]) m Integer.parseInt(score[0]) Integer.parseInt Integer score[0] score 0 f = Integer.parseInt(score[1]) f Integer.parseInt(score[1]) Integer.parseInt Integer score[1] score 1 r = Integer.parseInt(score[2]) r Integer.parseInt(score[2]) Integer.parseInt Integer score[2] score 2 if(m==-1 && f==-1 && r==-1){
				break;
			} 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){
				out.println("F");
			}else if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			} m==-1 || f==-1 m==-1 m -1 1 f==-1 f -1 1 {
				out.println("F");
			} out.println("F") out.println out "F" if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			} m+f >= 80 m+f m f 80 {
				out.println("A");
			} out.println("A") out.println out "A" if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			} m+f >= 65 m+f m f 65 {
				out.println("B");
			} out.println("B") out.println out "B" if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			} m+f >= 50 || r>=50 m+f >= 50 m+f m f 50 r>=50 r 50 {
				out.println("C");
			} out.println("C") out.println out "C" if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			} m+f >= 30 m+f m f 30 {
				out.println("D");
			} out.println("D") out.println out "D" {
				out.println("F");
			} out.println("F") out.println out "F" String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintStream out = System.out;
		int m, f, r;
		while(true){
			String[] score = in.readLine().split(" ");
			m = Integer.parseInt(score[0]);
			f = Integer.parseInt(score[1]);
			r = Integer.parseInt(score[2]);
			if(m==-1 && f==-1 && r==-1){
				break;
			}
			if(m==-1 || f==-1){
				out.println("F");
			}else if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			}
		}
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintStream out = System.out;
		int m, f, r;
		while(true){
			String[] score = in.readLine().split(" ");
			m = Integer.parseInt(score[0]);
			f = Integer.parseInt(score[1]);
			r = Integer.parseInt(score[2]);
			if(m==-1 && f==-1 && r==-1){
				break;
			}
			if(m==-1 || f==-1){
				out.println("F");
			}else if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			}
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintStream out = System.out;
		int m, f, r;
		while(true){
			String[] score = in.readLine().split(" ");
			m = Integer.parseInt(score[0]);
			f = Integer.parseInt(score[1]);
			r = Integer.parseInt(score[2]);
			if(m==-1 && f==-1 && r==-1){
				break;
			}
			if(m==-1 || f==-1){
				out.println("F");
			}else if(m+f >= 80){
				out.println("A");
			}else if(m+f >= 65){
				out.println("B");
			}else if(m+f >= 50 || r>=50){
				out.println("C");
			}else if(m+f >= 30){
				out.println("D");
			}else {
				out.println("F");
			}
		}
	}
}