import java.io.*;

class Main {
	public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
		
			int[] mfr= new int[5];
			int sum=0;
			String[] tmpArray;	
			while( true ) {
				String str = kb.readLine();
				tmpArray = str.split( " " );
				if( "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) ) {
					break;
				}
				sum=0;
				for( int i=0; i<3; i++ ) {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				}
				if( sum<30 || -1==mfr[0] || -1==mfr[1] ) {
					System.out.println( "F" );
				} else if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		}
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
		
			int[] mfr= new int[5];
			int sum=0;
			String[] tmpArray;	
			while( true ) {
				String str = kb.readLine();
				tmpArray = str.split( " " );
				if( "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) ) {
					break;
				}
				sum=0;
				for( int i=0; i<3; i++ ) {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				}
				if( sum<30 || -1==mfr[0] || -1==mfr[1] ) {
					System.out.println( "F" );
				} else if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		}
	}
} Main public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
		
			int[] mfr= new int[5];
			int sum=0;
			String[] tmpArray;	
			while( true ) {
				String str = kb.readLine();
				tmpArray = str.split( " " );
				if( "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) ) {
					break;
				}
				sum=0;
				for( int i=0; i<3; i++ ) {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				}
				if( sum<30 || -1==mfr[0] || -1==mfr[1] ) {
					System.out.println( "F" );
				} else if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		}
	} main {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
		
			int[] mfr= new int[5];
			int sum=0;
			String[] tmpArray;	
			while( true ) {
				String str = kb.readLine();
				tmpArray = str.split( " " );
				if( "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) ) {
					break;
				}
				sum=0;
				for( int i=0; i<3; i++ ) {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				}
				if( sum<30 || -1==mfr[0] || -1==mfr[1] ) {
					System.out.println( "F" );
				} else if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		}
	} BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) ); kb new BufferedReader( new InputStreamReader( System.in ) ) try {
		
			int[] mfr= new int[5];
			int sum=0;
			String[] tmpArray;	
			while( true ) {
				String str = kb.readLine();
				tmpArray = str.split( " " );
				if( "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) ) {
					break;
				}
				sum=0;
				for( int i=0; i<3; i++ ) {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				}
				if( sum<30 || -1==mfr[0] || -1==mfr[1] ) {
					System.out.println( "F" );
				} else if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		} catch( IOException e ) {
			System.err.println( e );
		} IOException e {
			System.err.println( e );
		} System.err.println( e ) System.err.println System.err System System.err e {
		
			int[] mfr= new int[5];
			int sum=0;
			String[] tmpArray;	
			while( true ) {
				String str = kb.readLine();
				tmpArray = str.split( " " );
				if( "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) ) {
					break;
				}
				sum=0;
				for( int i=0; i<3; i++ ) {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				}
				if( sum<30 || -1==mfr[0] || -1==mfr[1] ) {
					System.out.println( "F" );
				} else if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				}
			}
		} int[] mfr= new int[5]; mfr new int[5] 5 int sum=0; sum 0 String[] tmpArray; tmpArray while( true ) {
				String str = kb.readLine();
				tmpArray = str.split( " " );
				if( "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) ) {
					break;
				}
				sum=0;
				for( int i=0; i<3; i++ ) {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				}
				if( sum<30 || -1==mfr[0] || -1==mfr[1] ) {
					System.out.println( "F" );
				} else if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				}
			} true {
				String str = kb.readLine();
				tmpArray = str.split( " " );
				if( "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) ) {
					break;
				}
				sum=0;
				for( int i=0; i<3; i++ ) {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				}
				if( sum<30 || -1==mfr[0] || -1==mfr[1] ) {
					System.out.println( "F" );
				} else if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				}
			} String str = kb.readLine(); str kb.readLine() kb.readLine kb tmpArray = str.split( " " ) tmpArray str.split( " " ) str.split str " " if( "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) ) {
					break;
				} "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) "-1".equals( tmpArray[0] ) "-1".equals "-1" tmpArray[0] tmpArray 0 "-1".equals( tmpArray[1] ) "-1".equals "-1" tmpArray[1] tmpArray 1 "-1".equals( tmpArray[2] ) "-1".equals "-1" tmpArray[2] tmpArray 2 {
					break;
				} break; sum=0 sum 0 for( int i=0; i<3; i++ ) {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				} {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				} mfr[i]=Integer.parseInt( tmpArray[i] ) mfr[i] mfr i Integer.parseInt( tmpArray[i] ) Integer.parseInt Integer tmpArray[i] tmpArray i if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					} -1 != mfr[i] && 2 != i -1 != mfr[i] -1 1 mfr[i] mfr i 2 != i 2 i {
						sum+=mfr[i];
					} sum+=mfr[i] sum mfr[i] mfr i if( sum<30 || -1==mfr[0] || -1==mfr[1] ) {
					System.out.println( "F" );
				} else if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				} sum<30 || -1==mfr[0] || -1==mfr[1] sum<30 || -1==mfr[0] || -1==mfr[1] sum<30 sum 30 -1==mfr[0] -1 1 mfr[0] mfr 0 -1==mfr[1] -1 1 mfr[1] mfr 1 {
					System.out.println( "F" );
				} System.out.println( "F" ) System.out.println System.out System System.out "F" if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				} 80 <= sum 80 sum {
					System.out.println( "A" );
				} System.out.println( "A" ) System.out.println System.out System System.out "A" if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				} 65<=sum && sum<80 65<=sum 65 sum sum<80 sum 80 {
					System.out.println( "B" );
				} System.out.println( "B" ) System.out.println System.out System System.out "B" if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				} 50<=sum && sum<65 50<=sum 50 sum sum<65 sum 65 {
					System.out.println( "C" );
				} System.out.println( "C" ) System.out.println System.out System System.out "C" if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				} 30<=sum && sum<50 30<=sum 30 sum sum<50 sum 50 {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				} if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					} 50<=mfr[2] 50 mfr[2] mfr 2 {
						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" String[] args args
import java.io.*;

class Main {
	public static void main(String[] args) {
		BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
		try {
		
			int[] mfr= new int[5];
			int sum=0;
			String[] tmpArray;	
			while( true ) {
				String str = kb.readLine();
				tmpArray = str.split( " " );
				if( "-1".equals( tmpArray[0] ) && "-1".equals( tmpArray[1] ) 
						&& "-1".equals( tmpArray[2] ) ) {
					break;
				}
				sum=0;
				for( int i=0; i<3; i++ ) {
					mfr[i]=Integer.parseInt( tmpArray[i] );
					if( -1 != mfr[i] && 2 != i ) {
						sum+=mfr[i];
					}
				}
				if( sum<30 || -1==mfr[0] || -1==mfr[1] ) {
					System.out.println( "F" );
				} else if( 80 <= sum ) {
					System.out.println( "A" );
				} else if( 65<=sum && sum<80 ) {
					System.out.println( "B" );
				} else if( 50<=sum && sum<65 ) {
					System.out.println( "C" );
				} else if( 30<=sum && sum<50 ) {
					if( 50<=mfr[2] ) {
						System.out.println( "C" );
					} else {
						System.out.println( "D" );
					}
				}
			}
		} catch( IOException e ) {
			System.err.println( e );
		}
	}
}