import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		while(true) {
			int mid=in.nextInt(),fin=in.nextInt(),re=in.nextInt();
			if(mid==-1 && fin==-1 && re==-1)break;
			char jd;
			if(mid==-1 || fin==-1)jd='F';
			else if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F';
			out.println(jd);
		}
		out.flush();
	}

}
 import java.util.*; util.* java import java.io.*; io.* java public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		while(true) {
			int mid=in.nextInt(),fin=in.nextInt(),re=in.nextInt();
			if(mid==-1 && fin==-1 && re==-1)break;
			char jd;
			if(mid==-1 || fin==-1)jd='F';
			else if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F';
			out.println(jd);
		}
		out.flush();
	}

} Main public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		while(true) {
			int mid=in.nextInt(),fin=in.nextInt(),re=in.nextInt();
			if(mid==-1 && fin==-1 && re==-1)break;
			char jd;
			if(mid==-1 || fin==-1)jd='F';
			else if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F';
			out.println(jd);
		}
		out.flush();
	} main {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		while(true) {
			int mid=in.nextInt(),fin=in.nextInt(),re=in.nextInt();
			if(mid==-1 && fin==-1 && re==-1)break;
			char jd;
			if(mid==-1 || fin==-1)jd='F';
			else if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F';
			out.println(jd);
		}
		out.flush();
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) PrintWriter out=new PrintWriter(System.out); out new PrintWriter(System.out) while(true) {
			int mid=in.nextInt(),fin=in.nextInt(),re=in.nextInt();
			if(mid==-1 && fin==-1 && re==-1)break;
			char jd;
			if(mid==-1 || fin==-1)jd='F';
			else if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F';
			out.println(jd);
		} true {
			int mid=in.nextInt(),fin=in.nextInt(),re=in.nextInt();
			if(mid==-1 && fin==-1 && re==-1)break;
			char jd;
			if(mid==-1 || fin==-1)jd='F';
			else if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F';
			out.println(jd);
		} int mid=in.nextInt() mid in.nextInt() in.nextInt in fin=in.nextInt() fin in.nextInt() in.nextInt in re=in.nextInt(); re in.nextInt() in.nextInt in if(mid==-1 && fin==-1 && re==-1)break; mid==-1 && fin==-1 && re==-1 mid==-1 && fin==-1 && re==-1 mid==-1 mid -1 1 fin==-1 fin -1 1 re==-1 re -1 1 break; char jd; jd if(mid==-1 || fin==-1)jd='F';
			else if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F'; mid==-1 || fin==-1 mid==-1 mid -1 1 fin==-1 fin -1 1 jd='F' jd 'F' if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F'; mid+fin>=80 mid+fin mid fin 80 jd='A' jd 'A' if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F'; mid+fin>=65 mid+fin mid fin 65 jd='B' jd 'B' if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F'; mid+fin>=50 mid+fin mid fin 50 jd='C' jd 'C' if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F'; mid+fin>=30 mid+fin mid fin 30 {
				if(re>=50)jd='C';
				else jd='D';
			} if(re>=50)jd='C';
				else jd='D'; re>=50 re 50 jd='C' jd 'C' jd='D' jd 'D' jd='F' jd 'F' out.println(jd) out.println out jd out.flush() out.flush out String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		while(true) {
			int mid=in.nextInt(),fin=in.nextInt(),re=in.nextInt();
			if(mid==-1 && fin==-1 && re==-1)break;
			char jd;
			if(mid==-1 || fin==-1)jd='F';
			else if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F';
			out.println(jd);
		}
		out.flush();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		while(true) {
			int mid=in.nextInt(),fin=in.nextInt(),re=in.nextInt();
			if(mid==-1 && fin==-1 && re==-1)break;
			char jd;
			if(mid==-1 || fin==-1)jd='F';
			else if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F';
			out.println(jd);
		}
		out.flush();
	}

} Main
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		while(true) {
			int mid=in.nextInt(),fin=in.nextInt(),re=in.nextInt();
			if(mid==-1 && fin==-1 && re==-1)break;
			char jd;
			if(mid==-1 || fin==-1)jd='F';
			else if(mid+fin>=80)jd='A';
			else if(mid+fin>=65)jd='B';
			else if(mid+fin>=50)jd='C';
			else if(mid+fin>=30) {
				if(re>=50)jd='C';
				else jd='D';
			}
			else jd='F';
			out.println(jd);
		}
		out.flush();
	}

}

