import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int s=0;
		ArrayList<String> list=new ArrayList<String>();
		while(s!=-3) {
			//値の入力
			StringTokenizer st=new StringTokenizer(br.readLine());
			int m=Integer.parseInt(st.nextToken());
			int f=Integer.parseInt(st.nextToken());
			int r=Integer.parseInt(st.nextToken());
			s=m+f+r;
			int mf=m+f;

			if(s==-3) {
				break;
			}

			//式の評価
			String eva="";
			if(m==-1 || f==-1) {
				eva="F";
			}else if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			}

			//配列への追加
			list.add(eva);
		}
		//評価の出力
		for(String lists:list) {
			System.out.println(lists);
		}
	}

}
 import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int s=0;
		ArrayList<String> list=new ArrayList<String>();
		while(s!=-3) {
			//値の入力
			StringTokenizer st=new StringTokenizer(br.readLine());
			int m=Integer.parseInt(st.nextToken());
			int f=Integer.parseInt(st.nextToken());
			int r=Integer.parseInt(st.nextToken());
			s=m+f+r;
			int mf=m+f;

			if(s==-3) {
				break;
			}

			//式の評価
			String eva="";
			if(m==-1 || f==-1) {
				eva="F";
			}else if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			}

			//配列への追加
			list.add(eva);
		}
		//評価の出力
		for(String lists:list) {
			System.out.println(lists);
		}
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int s=0;
		ArrayList<String> list=new ArrayList<String>();
		while(s!=-3) {
			//値の入力
			StringTokenizer st=new StringTokenizer(br.readLine());
			int m=Integer.parseInt(st.nextToken());
			int f=Integer.parseInt(st.nextToken());
			int r=Integer.parseInt(st.nextToken());
			s=m+f+r;
			int mf=m+f;

			if(s==-3) {
				break;
			}

			//式の評価
			String eva="";
			if(m==-1 || f==-1) {
				eva="F";
			}else if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			}

			//配列への追加
			list.add(eva);
		}
		//評価の出力
		for(String lists:list) {
			System.out.println(lists);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int s=0;
		ArrayList<String> list=new ArrayList<String>();
		while(s!=-3) {
			//値の入力
			StringTokenizer st=new StringTokenizer(br.readLine());
			int m=Integer.parseInt(st.nextToken());
			int f=Integer.parseInt(st.nextToken());
			int r=Integer.parseInt(st.nextToken());
			s=m+f+r;
			int mf=m+f;

			if(s==-3) {
				break;
			}

			//式の評価
			String eva="";
			if(m==-1 || f==-1) {
				eva="F";
			}else if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			}

			//配列への追加
			list.add(eva);
		}
		//評価の出力
		for(String lists:list) {
			System.out.println(lists);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int s=0; s 0 ArrayList<String> list=new ArrayList<String>(); list new ArrayList<String>() while(s!=-3) {
			//値の入力
			StringTokenizer st=new StringTokenizer(br.readLine());
			int m=Integer.parseInt(st.nextToken());
			int f=Integer.parseInt(st.nextToken());
			int r=Integer.parseInt(st.nextToken());
			s=m+f+r;
			int mf=m+f;

			if(s==-3) {
				break;
			}

			//式の評価
			String eva="";
			if(m==-1 || f==-1) {
				eva="F";
			}else if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			}

			//配列への追加
			list.add(eva);
		} s!=-3 s -3 3 {
			//値の入力
			StringTokenizer st=new StringTokenizer(br.readLine());
			int m=Integer.parseInt(st.nextToken());
			int f=Integer.parseInt(st.nextToken());
			int r=Integer.parseInt(st.nextToken());
			s=m+f+r;
			int mf=m+f;

			if(s==-3) {
				break;
			}

			//式の評価
			String eva="";
			if(m==-1 || f==-1) {
				eva="F";
			}else if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			}

			//配列への追加
			list.add(eva);
		} StringTokenizer st=new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) int m=Integer.parseInt(st.nextToken()); m Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int f=Integer.parseInt(st.nextToken()); f Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int r=Integer.parseInt(st.nextToken()); r Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st s=m+f+r s m+f+r m+f+r m f r int mf=m+f; mf m+f m f if(s==-3) {
				break;
			} s==-3 s -3 3 {
				break;
			} break; String eva=""; eva "" if(m==-1 || f==-1) {
				eva="F";
			}else if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			} m==-1 || f==-1 m==-1 m -1 1 f==-1 f -1 1 {
				eva="F";
			} eva="F" eva "F" if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			} mf>=80 mf 80 {
				eva="A";
			} eva="A" eva "A" if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			} 65<=mf && mf<80 65<=mf 65 mf mf<80 mf 80 {
				eva="B";
			} eva="B" eva "B" if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			} 50<=mf && mf<65 || r>=50 50<=mf && mf<65 50<=mf 50 mf mf<65 mf 65 r>=50 r 50 {
				eva="C";
			} eva="C" eva "C" if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			} 30<=mf && mf<50 30<=mf 30 mf mf<50 mf 50 {
				eva="D";
			} eva="D" eva "D" {
				eva="F";
			} eva="F" eva "F" list.add(eva) list.add list eva for(String lists:list) {
			System.out.println(lists);
		} String lists list {
			System.out.println(lists);
		} {
			System.out.println(lists);
		} System.out.println(lists) System.out.println System.out System System.out lists String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int s=0;
		ArrayList<String> list=new ArrayList<String>();
		while(s!=-3) {
			//値の入力
			StringTokenizer st=new StringTokenizer(br.readLine());
			int m=Integer.parseInt(st.nextToken());
			int f=Integer.parseInt(st.nextToken());
			int r=Integer.parseInt(st.nextToken());
			s=m+f+r;
			int mf=m+f;

			if(s==-3) {
				break;
			}

			//式の評価
			String eva="";
			if(m==-1 || f==-1) {
				eva="F";
			}else if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			}

			//配列への追加
			list.add(eva);
		}
		//評価の出力
		for(String lists:list) {
			System.out.println(lists);
		}
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int s=0;
		ArrayList<String> list=new ArrayList<String>();
		while(s!=-3) {
			//値の入力
			StringTokenizer st=new StringTokenizer(br.readLine());
			int m=Integer.parseInt(st.nextToken());
			int f=Integer.parseInt(st.nextToken());
			int r=Integer.parseInt(st.nextToken());
			s=m+f+r;
			int mf=m+f;

			if(s==-3) {
				break;
			}

			//式の評価
			String eva="";
			if(m==-1 || f==-1) {
				eva="F";
			}else if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			}

			//配列への追加
			list.add(eva);
		}
		//評価の出力
		for(String lists:list) {
			System.out.println(lists);
		}
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int s=0;
		ArrayList<String> list=new ArrayList<String>();
		while(s!=-3) {
			//値の入力
			StringTokenizer st=new StringTokenizer(br.readLine());
			int m=Integer.parseInt(st.nextToken());
			int f=Integer.parseInt(st.nextToken());
			int r=Integer.parseInt(st.nextToken());
			s=m+f+r;
			int mf=m+f;

			if(s==-3) {
				break;
			}

			//式の評価
			String eva="";
			if(m==-1 || f==-1) {
				eva="F";
			}else if(mf>=80) {
				eva="A";
			}else if(65<=mf && mf<80) {
				eva="B";
			}else if(50<=mf && mf<65 || r>=50) {
				eva="C";
			}else if(30<=mf && mf<50) {
				eva="D";
			}else {
				eva="F";
			}

			//配列への追加
			list.add(eva);
		}
		//評価の出力
		for(String lists:list) {
			System.out.println(lists);
		}
	}

}

