import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
		int f=sc.nextInt();
		int r=sc.nextInt();
		int g=m+f;
		String out;
		while(m!=-1 || f!=-1 || r !=-1){
			if(m==-1 || f==-1){
				out="F";
			}else if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if
		System.out.println(out);
		m=sc.nextInt();
		f=sc.nextInt();
		r=sc.nextInt();
		g=m+f;
		}//while
		
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
		int f=sc.nextInt();
		int r=sc.nextInt();
		int g=m+f;
		String out;
		while(m!=-1 || f!=-1 || r !=-1){
			if(m==-1 || f==-1){
				out="F";
			}else if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if
		System.out.println(out);
		m=sc.nextInt();
		f=sc.nextInt();
		r=sc.nextInt();
		g=m+f;
		}//while
		
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
		int f=sc.nextInt();
		int r=sc.nextInt();
		int g=m+f;
		String out;
		while(m!=-1 || f!=-1 || r !=-1){
			if(m==-1 || f==-1){
				out="F";
			}else if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if
		System.out.println(out);
		m=sc.nextInt();
		f=sc.nextInt();
		r=sc.nextInt();
		g=m+f;
		}//while
		
	} main {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
		int f=sc.nextInt();
		int r=sc.nextInt();
		int g=m+f;
		String out;
		while(m!=-1 || f!=-1 || r !=-1){
			if(m==-1 || f==-1){
				out="F";
			}else if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if
		System.out.println(out);
		m=sc.nextInt();
		f=sc.nextInt();
		r=sc.nextInt();
		g=m+f;
		}//while
		
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int m=sc.nextInt(); m sc.nextInt() sc.nextInt sc int f=sc.nextInt(); f sc.nextInt() sc.nextInt sc int r=sc.nextInt(); r sc.nextInt() sc.nextInt sc int g=m+f; g m+f m f String out; out while(m!=-1 || f!=-1 || r !=-1){
			if(m==-1 || f==-1){
				out="F";
			}else if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if
		System.out.println(out);
		m=sc.nextInt();
		f=sc.nextInt();
		r=sc.nextInt();
		g=m+f;
		}//while 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 {
			if(m==-1 || f==-1){
				out="F";
			}else if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if
		System.out.println(out);
		m=sc.nextInt();
		f=sc.nextInt();
		r=sc.nextInt();
		g=m+f;
		} if(m==-1 || f==-1){
				out="F";
			}else if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if m==-1 || f==-1 m==-1 m -1 1 f==-1 f -1 1 {
				out="F";
			} out="F" out "F" if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if g>=80 g 80 {
				out="A";
			} out="A" out "A" if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if g>=65 g 65 {
				out="B";
			} out="B" out "B" if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if g>=50 g 50 {
				out="C";
			} out="C" out "C" if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if g>=30 g 30 {
				if(r>=50){
					out="C";
				}else out="D";
			} if(r>=50){
					out="C";
				}else out="D"; r>=50 r 50 {
					out="C";
				} out="C" out "C" out="D" out "D" { 
				out="F";
			} out="F" out "F" System.out.println(out) System.out.println System.out System System.out out m=sc.nextInt() m sc.nextInt() sc.nextInt sc f=sc.nextInt() f sc.nextInt() sc.nextInt sc r=sc.nextInt() r sc.nextInt() sc.nextInt sc g=m+f g m+f m f String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
		int f=sc.nextInt();
		int r=sc.nextInt();
		int g=m+f;
		String out;
		while(m!=-1 || f!=-1 || r !=-1){
			if(m==-1 || f==-1){
				out="F";
			}else if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if
		System.out.println(out);
		m=sc.nextInt();
		f=sc.nextInt();
		r=sc.nextInt();
		g=m+f;
		}//while
		
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
		int f=sc.nextInt();
		int r=sc.nextInt();
		int g=m+f;
		String out;
		while(m!=-1 || f!=-1 || r !=-1){
			if(m==-1 || f==-1){
				out="F";
			}else if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if
		System.out.println(out);
		m=sc.nextInt();
		f=sc.nextInt();
		r=sc.nextInt();
		g=m+f;
		}//while
		
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int m=sc.nextInt();
		int f=sc.nextInt();
		int r=sc.nextInt();
		int g=m+f;
		String out;
		while(m!=-1 || f!=-1 || r !=-1){
			if(m==-1 || f==-1){
				out="F";
			}else if(g>=80){
				out="A";
			}else if(g>=65){
				out="B";
			}else if(g>=50){
				out="C";
			}else if(g>=30){
				if(r>=50){
					out="C";
				}else out="D";
			}else{ 
				out="F";
			}//if
		System.out.println(out);
		m=sc.nextInt();
		f=sc.nextInt();
		r=sc.nextInt();
		g=m+f;
		}//while
		
	}
}