import java.io.*;

public class Main {
	
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] strargs;
		String grade;
		int m, f, r, score;

		do {
			grade = null;
			strargs = br.readLine().split("\\s+");
			m = Integer.parseInt(strargs[0]);
			f = Integer.parseInt(strargs[1]);
			r = Integer.parseInt(strargs[2]);
			score = Math.addExact(m, f);
			
			if (score >= 80) 		{	grade = "A";
			} else if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			}
			if (m == -1 || f == -1) grade ="F";
			if (m == -1 && f == -1 && r == -1) break;
			sb.append(grade);
			sb.append("\n");
		} while(true);
		
		System.out.print(sb);
	}
} import java.io.*; io.* java public class Main {
	
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] strargs;
		String grade;
		int m, f, r, score;

		do {
			grade = null;
			strargs = br.readLine().split("\\s+");
			m = Integer.parseInt(strargs[0]);
			f = Integer.parseInt(strargs[1]);
			r = Integer.parseInt(strargs[2]);
			score = Math.addExact(m, f);
			
			if (score >= 80) 		{	grade = "A";
			} else if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			}
			if (m == -1 || f == -1) grade ="F";
			if (m == -1 && f == -1 && r == -1) break;
			sb.append(grade);
			sb.append("\n");
		} while(true);
		
		System.out.print(sb);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] strargs;
		String grade;
		int m, f, r, score;

		do {
			grade = null;
			strargs = br.readLine().split("\\s+");
			m = Integer.parseInt(strargs[0]);
			f = Integer.parseInt(strargs[1]);
			r = Integer.parseInt(strargs[2]);
			score = Math.addExact(m, f);
			
			if (score >= 80) 		{	grade = "A";
			} else if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			}
			if (m == -1 || f == -1) grade ="F";
			if (m == -1 && f == -1 && r == -1) break;
			sb.append(grade);
			sb.append("\n");
		} while(true);
		
		System.out.print(sb);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] strargs;
		String grade;
		int m, f, r, score;

		do {
			grade = null;
			strargs = br.readLine().split("\\s+");
			m = Integer.parseInt(strargs[0]);
			f = Integer.parseInt(strargs[1]);
			r = Integer.parseInt(strargs[2]);
			score = Math.addExact(m, f);
			
			if (score >= 80) 		{	grade = "A";
			} else if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			}
			if (m == -1 || f == -1) grade ="F";
			if (m == -1 && f == -1 && r == -1) break;
			sb.append(grade);
			sb.append("\n");
		} while(true);
		
		System.out.print(sb);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String[] strargs; strargs String grade; grade int m m f f r r score; score do {
			grade = null;
			strargs = br.readLine().split("\\s+");
			m = Integer.parseInt(strargs[0]);
			f = Integer.parseInt(strargs[1]);
			r = Integer.parseInt(strargs[2]);
			score = Math.addExact(m, f);
			
			if (score >= 80) 		{	grade = "A";
			} else if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			}
			if (m == -1 || f == -1) grade ="F";
			if (m == -1 && f == -1 && r == -1) break;
			sb.append(grade);
			sb.append("\n");
		} while(true); true {
			grade = null;
			strargs = br.readLine().split("\\s+");
			m = Integer.parseInt(strargs[0]);
			f = Integer.parseInt(strargs[1]);
			r = Integer.parseInt(strargs[2]);
			score = Math.addExact(m, f);
			
			if (score >= 80) 		{	grade = "A";
			} else if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			}
			if (m == -1 || f == -1) grade ="F";
			if (m == -1 && f == -1 && r == -1) break;
			sb.append(grade);
			sb.append("\n");
		} grade = null grade null strargs = br.readLine().split("\\s+") strargs br.readLine().split("\\s+") br.readLine().split br.readLine() br.readLine br "\\s+" m = Integer.parseInt(strargs[0]) m Integer.parseInt(strargs[0]) Integer.parseInt Integer strargs[0] strargs 0 f = Integer.parseInt(strargs[1]) f Integer.parseInt(strargs[1]) Integer.parseInt Integer strargs[1] strargs 1 r = Integer.parseInt(strargs[2]) r Integer.parseInt(strargs[2]) Integer.parseInt Integer strargs[2] strargs 2 score = Math.addExact(m, f) score Math.addExact(m, f) Math.addExact Math m f if (score >= 80) 		{	grade = "A";
			} else if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			} score >= 80 score 80 {	grade = "A";
			} grade = "A" grade "A" if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			} score >= 65 score 65 {	grade = "B";
			} grade = "B" grade "B" if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			} score >= 50 score 50 {	grade = "C";
			} grade = "C" grade "C" if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			} r >= 50 r 50 {	grade = "C";
			} grade = "C" grade "C" if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			} score >= 30 score 30 {	grade = "D";
			} grade = "D" grade "D" {	grade = "F";
			} grade = "F" grade "F" if (m == -1 || f == -1) grade ="F"; m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 grade ="F" grade "F" if (m == -1 && f == -1 && r == -1) break; 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 break; sb.append(grade) sb.append sb grade sb.append("\n") sb.append sb "\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {
	
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] strargs;
		String grade;
		int m, f, r, score;

		do {
			grade = null;
			strargs = br.readLine().split("\\s+");
			m = Integer.parseInt(strargs[0]);
			f = Integer.parseInt(strargs[1]);
			r = Integer.parseInt(strargs[2]);
			score = Math.addExact(m, f);
			
			if (score >= 80) 		{	grade = "A";
			} else if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			}
			if (m == -1 || f == -1) grade ="F";
			if (m == -1 && f == -1 && r == -1) break;
			sb.append(grade);
			sb.append("\n");
		} while(true);
		
		System.out.print(sb);
	}
} public class Main {
	
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] strargs;
		String grade;
		int m, f, r, score;

		do {
			grade = null;
			strargs = br.readLine().split("\\s+");
			m = Integer.parseInt(strargs[0]);
			f = Integer.parseInt(strargs[1]);
			r = Integer.parseInt(strargs[2]);
			score = Math.addExact(m, f);
			
			if (score >= 80) 		{	grade = "A";
			} else if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			}
			if (m == -1 || f == -1) grade ="F";
			if (m == -1 && f == -1 && r == -1) break;
			sb.append(grade);
			sb.append("\n");
		} while(true);
		
		System.out.print(sb);
	}
} Main
import java.io.*;

public class Main {
	
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();
		String[] strargs;
		String grade;
		int m, f, r, score;

		do {
			grade = null;
			strargs = br.readLine().split("\\s+");
			m = Integer.parseInt(strargs[0]);
			f = Integer.parseInt(strargs[1]);
			r = Integer.parseInt(strargs[2]);
			score = Math.addExact(m, f);
			
			if (score >= 80) 		{	grade = "A";
			} else if (score >= 65) {	grade = "B";
			} else if (score >= 50) {	grade = "C";
			} else if (r >= 50)	 	{	grade = "C";
			} else if (score >= 30) {	grade = "D";
			} else					{	grade = "F";
			}
			if (m == -1 || f == -1) grade ="F";
			if (m == -1 && f == -1 && r == -1) break;
			sb.append(grade);
			sb.append("\n");
		} while(true);
		
		System.out.print(sb);
	}
}