import java.util.*;
 
public class Main {
	public static final int M   = 0;
	public static final int F   = 1;
	public static final int R   = 2;

	public static final int ABSENT = -1;

	public static final int POINT_A = 80;
	public static final int POINT_B = 65;
	public static final int POINT_C = 50;
	public static final int POINT_D = 30;
	public static final int R_POINT = 50;
	
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );

        while( true ) {
            int m   = scan.nextInt();
            int f   = scan.nextInt();
            int r   = scan.nextInt();
             
            if ( m == ABSENT && f == ABSENT && r == ABSENT )
                break;
			
            String result = "F";
            int sum         = m + f;
             
            if ( m == ABSENT || f == ABSENT ) {
                result = "F";
             
            } else if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            }
             
            System.out.println(result);
             
        }
         
    }
} import java.util.*; util.* java public class Main {
	public static final int M   = 0;
	public static final int F   = 1;
	public static final int R   = 2;

	public static final int ABSENT = -1;

	public static final int POINT_A = 80;
	public static final int POINT_B = 65;
	public static final int POINT_C = 50;
	public static final int POINT_D = 30;
	public static final int R_POINT = 50;
	
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );

        while( true ) {
            int m   = scan.nextInt();
            int f   = scan.nextInt();
            int r   = scan.nextInt();
             
            if ( m == ABSENT && f == ABSENT && r == ABSENT )
                break;
			
            String result = "F";
            int sum         = m + f;
             
            if ( m == ABSENT || f == ABSENT ) {
                result = "F";
             
            } else if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            }
             
            System.out.println(result);
             
        }
         
    }
} Main public static final int M   = 0; M 0 public static final int F   = 1; F 1 public static final int R   = 2; R 2 public static final int ABSENT = -1; ABSENT -1 1 public static final int POINT_A = 80; POINT_A 80 public static final int POINT_B = 65; POINT_B 65 public static final int POINT_C = 50; POINT_C 50 public static final int POINT_D = 30; POINT_D 30 public static final int R_POINT = 50; R_POINT 50 public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );

        while( true ) {
            int m   = scan.nextInt();
            int f   = scan.nextInt();
            int r   = scan.nextInt();
             
            if ( m == ABSENT && f == ABSENT && r == ABSENT )
                break;
			
            String result = "F";
            int sum         = m + f;
             
            if ( m == ABSENT || f == ABSENT ) {
                result = "F";
             
            } else if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            }
             
            System.out.println(result);
             
        }
         
    } main {
        Scanner scan = new Scanner( System.in );

        while( true ) {
            int m   = scan.nextInt();
            int f   = scan.nextInt();
            int r   = scan.nextInt();
             
            if ( m == ABSENT && f == ABSENT && r == ABSENT )
                break;
			
            String result = "F";
            int sum         = m + f;
             
            if ( m == ABSENT || f == ABSENT ) {
                result = "F";
             
            } else if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            }
             
            System.out.println(result);
             
        }
         
    } Scanner scan = new Scanner( System.in ); scan new Scanner( System.in ) while( true ) {
            int m   = scan.nextInt();
            int f   = scan.nextInt();
            int r   = scan.nextInt();
             
            if ( m == ABSENT && f == ABSENT && r == ABSENT )
                break;
			
            String result = "F";
            int sum         = m + f;
             
            if ( m == ABSENT || f == ABSENT ) {
                result = "F";
             
            } else if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            }
             
            System.out.println(result);
             
        } true {
            int m   = scan.nextInt();
            int f   = scan.nextInt();
            int r   = scan.nextInt();
             
            if ( m == ABSENT && f == ABSENT && r == ABSENT )
                break;
			
            String result = "F";
            int sum         = m + f;
             
            if ( m == ABSENT || f == ABSENT ) {
                result = "F";
             
            } else if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            }
             
            System.out.println(result);
             
        } int m   = scan.nextInt(); m scan.nextInt() scan.nextInt scan int f   = scan.nextInt(); f scan.nextInt() scan.nextInt scan int r   = scan.nextInt(); r scan.nextInt() scan.nextInt scan if ( m == ABSENT && f == ABSENT && r == ABSENT )
                break; m == ABSENT && f == ABSENT && r == ABSENT m == ABSENT && f == ABSENT && r == ABSENT m == ABSENT m ABSENT f == ABSENT f ABSENT r == ABSENT r ABSENT break; String result = "F"; result "F" int sum         = m + f; sum m + f m f if ( m == ABSENT || f == ABSENT ) {
                result = "F";
             
            } else if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            } m == ABSENT || f == ABSENT m == ABSENT m ABSENT f == ABSENT f ABSENT {
                result = "F";
             
            } result = "F" result "F" if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            } sum >= POINT_A sum POINT_A {
                result = "A";
                 
            } result = "A" result "A" if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            } sum >= POINT_B && sum < POINT_A sum >= POINT_B sum POINT_B sum < POINT_A sum POINT_A {
                result = "B";
                 
            } result = "B" result "B" if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            } sum >= POINT_C && sum < POINT_B sum >= POINT_C sum POINT_C sum < POINT_B sum POINT_B {
                result = "C";
                 
            } result = "C" result "C" if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            } sum >= POINT_D && sum < POINT_C sum >= POINT_D sum POINT_D sum < POINT_C sum POINT_C {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } result = "D" result "D" if ( r >= 50 )	result = "C"; r >= 50 r 50 result = "C" result "C" if ( sum <= POINT_C ) {
                result = "F";
                 
            } sum <= POINT_C sum POINT_C {
                result = "F";
                 
            } result = "F" result "F" System.out.println(result) System.out.println System.out System System.out result String args[] args public class Main {
	public static final int M   = 0;
	public static final int F   = 1;
	public static final int R   = 2;

	public static final int ABSENT = -1;

	public static final int POINT_A = 80;
	public static final int POINT_B = 65;
	public static final int POINT_C = 50;
	public static final int POINT_D = 30;
	public static final int R_POINT = 50;
	
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );

        while( true ) {
            int m   = scan.nextInt();
            int f   = scan.nextInt();
            int r   = scan.nextInt();
             
            if ( m == ABSENT && f == ABSENT && r == ABSENT )
                break;
			
            String result = "F";
            int sum         = m + f;
             
            if ( m == ABSENT || f == ABSENT ) {
                result = "F";
             
            } else if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            }
             
            System.out.println(result);
             
        }
         
    }
} public class Main {
	public static final int M   = 0;
	public static final int F   = 1;
	public static final int R   = 2;

	public static final int ABSENT = -1;

	public static final int POINT_A = 80;
	public static final int POINT_B = 65;
	public static final int POINT_C = 50;
	public static final int POINT_D = 30;
	public static final int R_POINT = 50;
	
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );

        while( true ) {
            int m   = scan.nextInt();
            int f   = scan.nextInt();
            int r   = scan.nextInt();
             
            if ( m == ABSENT && f == ABSENT && r == ABSENT )
                break;
			
            String result = "F";
            int sum         = m + f;
             
            if ( m == ABSENT || f == ABSENT ) {
                result = "F";
             
            } else if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            }
             
            System.out.println(result);
             
        }
         
    }
} Main
import java.util.*;
 
public class Main {
	public static final int M   = 0;
	public static final int F   = 1;
	public static final int R   = 2;

	public static final int ABSENT = -1;

	public static final int POINT_A = 80;
	public static final int POINT_B = 65;
	public static final int POINT_C = 50;
	public static final int POINT_D = 30;
	public static final int R_POINT = 50;
	
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );

        while( true ) {
            int m   = scan.nextInt();
            int f   = scan.nextInt();
            int r   = scan.nextInt();
             
            if ( m == ABSENT && f == ABSENT && r == ABSENT )
                break;
			
            String result = "F";
            int sum         = m + f;
             
            if ( m == ABSENT || f == ABSENT ) {
                result = "F";
             
            } else if ( sum >= POINT_A ) {
                result = "A";
                 
            } else if ( sum >= POINT_B && sum < POINT_A ) {
                result = "B";
                 
            } else if ( sum >= POINT_C && sum < POINT_B ) {
                result = "C";
                 
            } else if ( sum >= POINT_D && sum < POINT_C ) {
                result = "D";
                 
                if ( r >= 50 )	result = "C";
                 
            } else if ( sum <= POINT_C ) {
                result = "F";
                 
            }
             
            System.out.println(result);
             
        }
         
    }
}