import java.io.*;
public class Main {

	public static void main(String[] args)throws IOException {
		
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		String[] num=str.split(" ");
		int m=Integer.parseInt(num[0]);
		int r=Integer.parseInt(num[1]);
		int f=Integer.parseInt(num[2]);
		while (m!=-1 || r!=-1 || f!=-1){
			
			if (m==-1 || r==-1){
				System.out.println("F");
			}else if(m+r>=80){
				System.out.println("A");
			}else if(m+r>=65){
				System.out.println("B");
			}else if(m+r>=50 || f>=50){
				System.out.println("C");
			}else if(m+r>=30){
				System.out.println("D");
			}else {
				System.out.println("F");
			}
			str=br.readLine();
			num=str.split(" ");
			m=Integer.parseInt(num[0]);
			r=Integer.parseInt(num[1]);
			f=Integer.parseInt(num[2]);
		}
	}
} import java.io.*; io.* java public class Main {

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

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

	public static void main(String[] args)throws IOException {
		
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		String[] num=str.split(" ");
		int m=Integer.parseInt(num[0]);
		int r=Integer.parseInt(num[1]);
		int f=Integer.parseInt(num[2]);
		while (m!=-1 || r!=-1 || f!=-1){
			
			if (m==-1 || r==-1){
				System.out.println("F");
			}else if(m+r>=80){
				System.out.println("A");
			}else if(m+r>=65){
				System.out.println("B");
			}else if(m+r>=50 || f>=50){
				System.out.println("C");
			}else if(m+r>=30){
				System.out.println("D");
			}else {
				System.out.println("F");
			}
			str=br.readLine();
			num=str.split(" ");
			m=Integer.parseInt(num[0]);
			r=Integer.parseInt(num[1]);
			f=Integer.parseInt(num[2]);
		}
	}
} Main
import java.io.*;
public class Main {

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