import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int m=stdIn.nextInt();
			int n=stdIn.nextInt();
			int r=stdIn.nextInt();
			int sum=m+n;
			String ans;
			if(m==-1&&n==-1&&r==-1)
				break;
			if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F";
			System.out.println(ans);
		}
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.lang.*; lang.* java import java.math.*; math.* java public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int m=stdIn.nextInt();
			int n=stdIn.nextInt();
			int r=stdIn.nextInt();
			int sum=m+n;
			String ans;
			if(m==-1&&n==-1&&r==-1)
				break;
			if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F";
			System.out.println(ans);
		}
	}
} Main public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int m=stdIn.nextInt();
			int n=stdIn.nextInt();
			int r=stdIn.nextInt();
			int sum=m+n;
			String ans;
			if(m==-1&&n==-1&&r==-1)
				break;
			if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F";
			System.out.println(ans);
		}
	} main {
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int m=stdIn.nextInt();
			int n=stdIn.nextInt();
			int r=stdIn.nextInt();
			int sum=m+n;
			String ans;
			if(m==-1&&n==-1&&r==-1)
				break;
			if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F";
			System.out.println(ans);
		}
	} Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
			int m=stdIn.nextInt();
			int n=stdIn.nextInt();
			int r=stdIn.nextInt();
			int sum=m+n;
			String ans;
			if(m==-1&&n==-1&&r==-1)
				break;
			if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F";
			System.out.println(ans);
		} true {
			int m=stdIn.nextInt();
			int n=stdIn.nextInt();
			int r=stdIn.nextInt();
			int sum=m+n;
			String ans;
			if(m==-1&&n==-1&&r==-1)
				break;
			if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F";
			System.out.println(ans);
		} int m=stdIn.nextInt(); m stdIn.nextInt() stdIn.nextInt stdIn int n=stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int r=stdIn.nextInt(); r stdIn.nextInt() stdIn.nextInt stdIn int sum=m+n; sum m+n m n String ans; ans if(m==-1&&n==-1&&r==-1)
				break; m==-1&&n==-1&&r==-1 m==-1&&n==-1&&r==-1 m==-1 m -1 1 n==-1 n -1 1 r==-1 r -1 1 break; if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F"; m==-1||n==-1 m==-1 m -1 1 n==-1 n -1 1 ans="F" ans "F" if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F"; sum>=80 sum 80 ans="A" ans "A" if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F"; sum>=65 sum 65 ans="B" ans "B" if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F"; sum>=50 sum 50 ans="C" ans "C" if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F"; sum>=30 sum 30 {
				if(r>=50)
					ans="C";
				else
					ans="D";
			} if(r>=50)
					ans="C";
				else
					ans="D"; r>=50 r 50 ans="C" ans "C" ans="D" ans "D" ans="F" ans "F" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int m=stdIn.nextInt();
			int n=stdIn.nextInt();
			int r=stdIn.nextInt();
			int sum=m+n;
			String ans;
			if(m==-1&&n==-1&&r==-1)
				break;
			if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F";
			System.out.println(ans);
		}
	}
} public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int m=stdIn.nextInt();
			int n=stdIn.nextInt();
			int r=stdIn.nextInt();
			int sum=m+n;
			String ans;
			if(m==-1&&n==-1&&r==-1)
				break;
			if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F";
			System.out.println(ans);
		}
	}
} Main
import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class Main{
	public static void main(String[] args) throws IOException{
		Scanner stdIn=new Scanner(System.in);
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int m=stdIn.nextInt();
			int n=stdIn.nextInt();
			int r=stdIn.nextInt();
			int sum=m+n;
			String ans;
			if(m==-1&&n==-1&&r==-1)
				break;
			if(m==-1||n==-1)
				ans="F";
			else if(sum>=80)
				ans="A";
			else if(sum>=65)
				ans="B";
			else if(sum>=50)
				ans="C";
			else if(sum>=30){
				if(r>=50)
					ans="C";
				else
					ans="D";
			}
			else
				ans="F";
			System.out.println(ans);
		}
	}
}