import java.io.*;

class Main {
	public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int m, f, r;

			while(true){
				String buf = br.readLine();
				String[] line = buf.split(" ");
				m = Integer.parseInt(line[0]);
				f = Integer.parseInt(line[1]);
				r = Integer.parseInt(line[2]);
				
					if(m == -1 && f == -1 && r == -1) break;			
					if(m == -1 || f == -1){
						System.out.println("F");
					} else if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					}
			
			}
		}catch(Exception e){
		}
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int m, f, r;

			while(true){
				String buf = br.readLine();
				String[] line = buf.split(" ");
				m = Integer.parseInt(line[0]);
				f = Integer.parseInt(line[1]);
				r = Integer.parseInt(line[2]);
				
					if(m == -1 && f == -1 && r == -1) break;			
					if(m == -1 || f == -1){
						System.out.println("F");
					} else if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					}
			
			}
		}catch(Exception e){
		}
	}
} Main public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int m, f, r;

			while(true){
				String buf = br.readLine();
				String[] line = buf.split(" ");
				m = Integer.parseInt(line[0]);
				f = Integer.parseInt(line[1]);
				r = Integer.parseInt(line[2]);
				
					if(m == -1 && f == -1 && r == -1) break;			
					if(m == -1 || f == -1){
						System.out.println("F");
					} else if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					}
			
			}
		}catch(Exception e){
		}
	} main {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int m, f, r;

			while(true){
				String buf = br.readLine();
				String[] line = buf.split(" ");
				m = Integer.parseInt(line[0]);
				f = Integer.parseInt(line[1]);
				r = Integer.parseInt(line[2]);
				
					if(m == -1 && f == -1 && r == -1) break;			
					if(m == -1 || f == -1){
						System.out.println("F");
					} else if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					}
			
			}
		}catch(Exception e){
		}
	} try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int m, f, r;

			while(true){
				String buf = br.readLine();
				String[] line = buf.split(" ");
				m = Integer.parseInt(line[0]);
				f = Integer.parseInt(line[1]);
				r = Integer.parseInt(line[2]);
				
					if(m == -1 && f == -1 && r == -1) break;			
					if(m == -1 || f == -1){
						System.out.println("F");
					} else if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					}
			
			}
		}catch(Exception e){
		} catch(Exception e){
		} Exception e {
		} {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int m, f, r;

			while(true){
				String buf = br.readLine();
				String[] line = buf.split(" ");
				m = Integer.parseInt(line[0]);
				f = Integer.parseInt(line[1]);
				r = Integer.parseInt(line[2]);
				
					if(m == -1 && f == -1 && r == -1) break;			
					if(m == -1 || f == -1){
						System.out.println("F");
					} else if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					}
			
			}
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int m m f f r; r while(true){
				String buf = br.readLine();
				String[] line = buf.split(" ");
				m = Integer.parseInt(line[0]);
				f = Integer.parseInt(line[1]);
				r = Integer.parseInt(line[2]);
				
					if(m == -1 && f == -1 && r == -1) break;			
					if(m == -1 || f == -1){
						System.out.println("F");
					} else if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					}
			
			} true {
				String buf = br.readLine();
				String[] line = buf.split(" ");
				m = Integer.parseInt(line[0]);
				f = Integer.parseInt(line[1]);
				r = Integer.parseInt(line[2]);
				
					if(m == -1 && f == -1 && r == -1) break;			
					if(m == -1 || f == -1){
						System.out.println("F");
					} else if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					}
			
			} String buf = br.readLine(); buf br.readLine() br.readLine br String[] line = buf.split(" "); line buf.split(" ") buf.split buf " " m = Integer.parseInt(line[0]) m Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 f = Integer.parseInt(line[1]) f Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 r = Integer.parseInt(line[2]) r Integer.parseInt(line[2]) Integer.parseInt Integer line[2] line 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){
						System.out.println("F");
					} else if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
						System.out.println("F");
					} System.out.println("F") System.out.println System.out System System.out "F" if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					} m+f >= 80 m+f m f 80 {
						System.out.println("A");
					} System.out.println("A") System.out.println System.out System System.out "A" if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					} (m+f) >= 65 && 80 > (m+f) (m+f) >= 65 (m+f) m f 65 80 > (m+f) 80 (m+f) m f {
						System.out.println("B");
					} System.out.println("B") System.out.println System.out System System.out "B" if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					} (m+f) >=50 && 65 > m+f (m+f) >=50 (m+f) m f 50 65 > m+f 65 m+f m f {
						System.out.println("C");
					} System.out.println("C") System.out.println System.out System System.out "C" if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					} m+f >=30 && 50 > m+f m+f >=30 m+f m f 30 50 > m+f 50 m+f m f {
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						} r < 50 r 50 {
							System.out.println("D");
						} System.out.println("D") System.out.println System.out System System.out "D" if ( r >=50){
							System.out.println("C");
						} r >=50 r 50 {
							System.out.println("C");
						} System.out.println("C") System.out.println System.out System System.out "C" if ( m+f < 30){
						System.out.println("F");
					} m+f < 30 m+f m f 30 {
						System.out.println("F");
					} System.out.println("F") System.out.println System.out System System.out "F" String[] args args
import java.io.*;

class Main {
	public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int m, f, r;

			while(true){
				String buf = br.readLine();
				String[] line = buf.split(" ");
				m = Integer.parseInt(line[0]);
				f = Integer.parseInt(line[1]);
				r = Integer.parseInt(line[2]);
				
					if(m == -1 && f == -1 && r == -1) break;			
					if(m == -1 || f == -1){
						System.out.println("F");
					} else if(m+f >= 80 ){
						System.out.println("A");
					} else if ((m+f) >= 65 && 80 > (m+f)){
						System.out.println("B");
					} else if ((m+f) >=50 && 65 > m+f){
						System.out.println("C");
					} else if ( m+f >=30 && 50 > m+f ){
						if(r < 50){
							System.out.println("D");
						}else if ( r >=50){
							System.out.println("C");
						}
					} else if ( m+f < 30){
						System.out.println("F");
					}
			
			}
		}catch(Exception e){
		}
	}
}