import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int tyukan,kimatu,saisi;
		int ten;
		Scanner scan = new Scanner(System.in);
		
		while(true)
		{
			
			tyukan=scan.nextInt();
			kimatu=scan.nextInt();
			saisi=scan.nextInt();
			if(tyukan==-1&&kimatu==-1&&saisi==-1)
				break;
			if(tyukan==-1||kimatu==-1){
				System.out.println("F");
			}else{
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			}
				
		}
		
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		int tyukan,kimatu,saisi;
		int ten;
		Scanner scan = new Scanner(System.in);
		
		while(true)
		{
			
			tyukan=scan.nextInt();
			kimatu=scan.nextInt();
			saisi=scan.nextInt();
			if(tyukan==-1&&kimatu==-1&&saisi==-1)
				break;
			if(tyukan==-1||kimatu==-1){
				System.out.println("F");
			}else{
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			}
				
		}
		
	}
} Main public static void main(String[] args) {
		int tyukan,kimatu,saisi;
		int ten;
		Scanner scan = new Scanner(System.in);
		
		while(true)
		{
			
			tyukan=scan.nextInt();
			kimatu=scan.nextInt();
			saisi=scan.nextInt();
			if(tyukan==-1&&kimatu==-1&&saisi==-1)
				break;
			if(tyukan==-1||kimatu==-1){
				System.out.println("F");
			}else{
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			}
				
		}
		
	} main {
		int tyukan,kimatu,saisi;
		int ten;
		Scanner scan = new Scanner(System.in);
		
		while(true)
		{
			
			tyukan=scan.nextInt();
			kimatu=scan.nextInt();
			saisi=scan.nextInt();
			if(tyukan==-1&&kimatu==-1&&saisi==-1)
				break;
			if(tyukan==-1||kimatu==-1){
				System.out.println("F");
			}else{
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			}
				
		}
		
	} int tyukan tyukan kimatu kimatu saisi; saisi int ten; ten Scanner scan = new Scanner(System.in); scan new Scanner(System.in) while(true)
		{
			
			tyukan=scan.nextInt();
			kimatu=scan.nextInt();
			saisi=scan.nextInt();
			if(tyukan==-1&&kimatu==-1&&saisi==-1)
				break;
			if(tyukan==-1||kimatu==-1){
				System.out.println("F");
			}else{
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			}
				
		} true {
			
			tyukan=scan.nextInt();
			kimatu=scan.nextInt();
			saisi=scan.nextInt();
			if(tyukan==-1&&kimatu==-1&&saisi==-1)
				break;
			if(tyukan==-1||kimatu==-1){
				System.out.println("F");
			}else{
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			}
				
		} tyukan=scan.nextInt() tyukan scan.nextInt() scan.nextInt scan kimatu=scan.nextInt() kimatu scan.nextInt() scan.nextInt scan saisi=scan.nextInt() saisi scan.nextInt() scan.nextInt scan if(tyukan==-1&&kimatu==-1&&saisi==-1)
				break; tyukan==-1&&kimatu==-1&&saisi==-1 tyukan==-1&&kimatu==-1&&saisi==-1 tyukan==-1 tyukan -1 1 kimatu==-1 kimatu -1 1 saisi==-1 saisi -1 1 break; if(tyukan==-1||kimatu==-1){
				System.out.println("F");
			}else{
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			} tyukan==-1||kimatu==-1 tyukan==-1 tyukan -1 1 kimatu==-1 kimatu -1 1 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" {
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			} if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				} tyukan+kimatu>=80 tyukan+kimatu tyukan kimatu 80 {
					System.out.println("A");
				} System.out.println("A") System.out.println System.out System System.out "A" {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				} if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					} tyukan+kimatu>=65 tyukan+kimatu tyukan kimatu 65 {
						System.out.println("B");
					} System.out.println("B") System.out.println System.out System System.out "B" {
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					} if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						} tyukan+kimatu>=50 tyukan+kimatu tyukan kimatu 50 {
							System.out.println("C");
						} System.out.println("C") System.out.println System.out System System.out "C" {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						} if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							} tyukan+kimatu>=30 tyukan+kimatu tyukan kimatu 30 {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							} if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								} saisi>=50 saisi 50 {
								System.out.println("C");
								} System.out.println("C") System.out.println System.out System System.out "C" {
									System.out.println("D");
								} System.out.println("D") System.out.println System.out System System.out "D" {
								System.out.println("F");
							} System.out.println("F") System.out.println System.out System System.out "F" String[] args args public class Main {
	public static void main(String[] args) {
		int tyukan,kimatu,saisi;
		int ten;
		Scanner scan = new Scanner(System.in);
		
		while(true)
		{
			
			tyukan=scan.nextInt();
			kimatu=scan.nextInt();
			saisi=scan.nextInt();
			if(tyukan==-1&&kimatu==-1&&saisi==-1)
				break;
			if(tyukan==-1||kimatu==-1){
				System.out.println("F");
			}else{
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			}
				
		}
		
	}
} public class Main {
	public static void main(String[] args) {
		int tyukan,kimatu,saisi;
		int ten;
		Scanner scan = new Scanner(System.in);
		
		while(true)
		{
			
			tyukan=scan.nextInt();
			kimatu=scan.nextInt();
			saisi=scan.nextInt();
			if(tyukan==-1&&kimatu==-1&&saisi==-1)
				break;
			if(tyukan==-1||kimatu==-1){
				System.out.println("F");
			}else{
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			}
				
		}
		
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int tyukan,kimatu,saisi;
		int ten;
		Scanner scan = new Scanner(System.in);
		
		while(true)
		{
			
			tyukan=scan.nextInt();
			kimatu=scan.nextInt();
			saisi=scan.nextInt();
			if(tyukan==-1&&kimatu==-1&&saisi==-1)
				break;
			if(tyukan==-1||kimatu==-1){
				System.out.println("F");
			}else{
				if(tyukan+kimatu>=80) {
					System.out.println("A");
				}else {
					if(tyukan+kimatu>=65) {
						System.out.println("B");
					}else{
						if(tyukan+kimatu>=50) {
							System.out.println("C");
						}else {
							if(tyukan+kimatu>=30) {
								if(saisi>=50) {
								System.out.println("C");
								}else {
									System.out.println("D");
								}
							}else {
								System.out.println("F");
							}
						}
					}
				}
					
			}
				
		}
		
	}
}