import java.io.*;

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

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