import java.util.Scanner;
 
class Main{
  public static void main(String[] arg){
    int m, f, r;

    Scanner in = new Scanner(System.in);

    while(true){
        m = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        
        if(m == -1 && f == -1 && r == -1) break;

        char check;
        if(m == -1 || f == -1) check = 'F';
        else if((m+f)>=80) check = 'A';
        else if((m+f)>=65) check = 'B';
        else if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F';

        System.out.println(check);
    }

  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] arg){
    int m, f, r;

    Scanner in = new Scanner(System.in);

    while(true){
        m = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        
        if(m == -1 && f == -1 && r == -1) break;

        char check;
        if(m == -1 || f == -1) check = 'F';
        else if((m+f)>=80) check = 'A';
        else if((m+f)>=65) check = 'B';
        else if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F';

        System.out.println(check);
    }

  }
} Main public static void main(String[] arg){
    int m, f, r;

    Scanner in = new Scanner(System.in);

    while(true){
        m = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        
        if(m == -1 && f == -1 && r == -1) break;

        char check;
        if(m == -1 || f == -1) check = 'F';
        else if((m+f)>=80) check = 'A';
        else if((m+f)>=65) check = 'B';
        else if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F';

        System.out.println(check);
    }

  } main {
    int m, f, r;

    Scanner in = new Scanner(System.in);

    while(true){
        m = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        
        if(m == -1 && f == -1 && r == -1) break;

        char check;
        if(m == -1 || f == -1) check = 'F';
        else if((m+f)>=80) check = 'A';
        else if((m+f)>=65) check = 'B';
        else if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F';

        System.out.println(check);
    }

  } int m m f f r; r Scanner in = new Scanner(System.in); in new Scanner(System.in) while(true){
        m = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        
        if(m == -1 && f == -1 && r == -1) break;

        char check;
        if(m == -1 || f == -1) check = 'F';
        else if((m+f)>=80) check = 'A';
        else if((m+f)>=65) check = 'B';
        else if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F';

        System.out.println(check);
    } true {
        m = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        
        if(m == -1 && f == -1 && r == -1) break;

        char check;
        if(m == -1 || f == -1) check = 'F';
        else if((m+f)>=80) check = 'A';
        else if((m+f)>=65) check = 'B';
        else if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F';

        System.out.println(check);
    } m = in.nextInt() m in.nextInt() in.nextInt in f = in.nextInt() f in.nextInt() in.nextInt in r = in.nextInt() r in.nextInt() in.nextInt in 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; char check; check if(m == -1 || f == -1) check = 'F';
        else if((m+f)>=80) check = 'A';
        else if((m+f)>=65) check = 'B';
        else if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F'; m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 check = 'F' check 'F' if((m+f)>=80) check = 'A';
        else if((m+f)>=65) check = 'B';
        else if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F'; (m+f)>=80 (m+f) m f 80 check = 'A' check 'A' if((m+f)>=65) check = 'B';
        else if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F'; (m+f)>=65 (m+f) m f 65 check = 'B' check 'B' if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F'; (m+f)>=50 (m+f) m f 50 check = 'C' check 'C' if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F'; (m+f)>=30 (m+f) m f 30 {
            if(r>=50) check = 'C';
            else check = 'D';

        } if(r>=50) check = 'C';
            else check = 'D'; r>=50 r 50 check = 'C' check 'C' check = 'D' check 'D' check = 'F' check 'F' System.out.println(check) System.out.println System.out System System.out check String[] arg arg
import java.util.Scanner;
 
class Main{
  public static void main(String[] arg){
    int m, f, r;

    Scanner in = new Scanner(System.in);

    while(true){
        m = in.nextInt();
        f = in.nextInt();
        r = in.nextInt();
        
        if(m == -1 && f == -1 && r == -1) break;

        char check;
        if(m == -1 || f == -1) check = 'F';
        else if((m+f)>=80) check = 'A';
        else if((m+f)>=65) check = 'B';
        else if((m+f)>=50) check = 'C';
        else if((m+f)>=30){
            if(r>=50) check = 'C';
            else check = 'D';

        }
        else check = 'F';

        System.out.println(check);
    }

  }
}