import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String crlf = System.getProperty("line.separator");
    int m, f, r;
    
    while(in.hasNext()) {
      m = in.nextInt();
      f = in.nextInt();
      r = in.nextInt();
      if (m == -1 && f == -1 && r == -1) return;
      int sum = m + f;
      
      if      ((m == -1 || f == -1) || (sum < 30)) System.out.println("F");
      else if (sum >= 80)                          System.out.println("A");
      else if (sum >= 65 && sum < 80)              System.out.println("B");
      else if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D");
    }
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String crlf = System.getProperty("line.separator");
    int m, f, r;
    
    while(in.hasNext()) {
      m = in.nextInt();
      f = in.nextInt();
      r = in.nextInt();
      if (m == -1 && f == -1 && r == -1) return;
      int sum = m + f;
      
      if      ((m == -1 || f == -1) || (sum < 30)) System.out.println("F");
      else if (sum >= 80)                          System.out.println("A");
      else if (sum >= 65 && sum < 80)              System.out.println("B");
      else if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D");
    }
  }
} Main public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String crlf = System.getProperty("line.separator");
    int m, f, r;
    
    while(in.hasNext()) {
      m = in.nextInt();
      f = in.nextInt();
      r = in.nextInt();
      if (m == -1 && f == -1 && r == -1) return;
      int sum = m + f;
      
      if      ((m == -1 || f == -1) || (sum < 30)) System.out.println("F");
      else if (sum >= 80)                          System.out.println("A");
      else if (sum >= 65 && sum < 80)              System.out.println("B");
      else if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D");
    }
  } main {
    Scanner in = new Scanner(System.in);
    String crlf = System.getProperty("line.separator");
    int m, f, r;
    
    while(in.hasNext()) {
      m = in.nextInt();
      f = in.nextInt();
      r = in.nextInt();
      if (m == -1 && f == -1 && r == -1) return;
      int sum = m + f;
      
      if      ((m == -1 || f == -1) || (sum < 30)) System.out.println("F");
      else if (sum >= 80)                          System.out.println("A");
      else if (sum >= 65 && sum < 80)              System.out.println("B");
      else if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D");
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) String crlf = System.getProperty("line.separator"); crlf System.getProperty("line.separator") System.getProperty System "line.separator" int m m f f r; r while(in.hasNext()) {
      m = in.nextInt();
      f = in.nextInt();
      r = in.nextInt();
      if (m == -1 && f == -1 && r == -1) return;
      int sum = m + f;
      
      if      ((m == -1 || f == -1) || (sum < 30)) System.out.println("F");
      else if (sum >= 80)                          System.out.println("A");
      else if (sum >= 65 && sum < 80)              System.out.println("B");
      else if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D");
    } in.hasNext() in.hasNext in {
      m = in.nextInt();
      f = in.nextInt();
      r = in.nextInt();
      if (m == -1 && f == -1 && r == -1) return;
      int sum = m + f;
      
      if      ((m == -1 || f == -1) || (sum < 30)) System.out.println("F");
      else if (sum >= 80)                          System.out.println("A");
      else if (sum >= 65 && sum < 80)              System.out.println("B");
      else if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D");
    } 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) return; 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 return; int sum = m + f; sum m + f m f if      ((m == -1 || f == -1) || (sum < 30)) System.out.println("F");
      else if (sum >= 80)                          System.out.println("A");
      else if (sum >= 65 && sum < 80)              System.out.println("B");
      else if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D"); (m == -1 || f == -1) || (sum < 30) (m == -1 || f == -1) m == -1 m -1 1 f == -1 f -1 1 (sum < 30) sum 30 System.out.println("F") System.out.println System.out System System.out "F" if (sum >= 80)                          System.out.println("A");
      else if (sum >= 65 && sum < 80)              System.out.println("B");
      else if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D"); sum >= 80 sum 80 System.out.println("A") System.out.println System.out System System.out "A" if (sum >= 65 && sum < 80)              System.out.println("B");
      else if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D"); sum >= 65 && sum < 80 sum >= 65 sum 65 sum < 80 sum 80 System.out.println("B") System.out.println System.out System System.out "B" if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D"); sum >= 50 && sum < 65 sum >= 50 sum 50 sum < 65 sum 65 System.out.println("C") System.out.println System.out System System.out "C" if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D"); r >= 50 r 50 System.out.println("C") System.out.println System.out System System.out "C" System.out.println("D") System.out.println System.out System System.out "D" String[] args args
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    String crlf = System.getProperty("line.separator");
    int m, f, r;
    
    while(in.hasNext()) {
      m = in.nextInt();
      f = in.nextInt();
      r = in.nextInt();
      if (m == -1 && f == -1 && r == -1) return;
      int sum = m + f;
      
      if      ((m == -1 || f == -1) || (sum < 30)) System.out.println("F");
      else if (sum >= 80)                          System.out.println("A");
      else if (sum >= 65 && sum < 80)              System.out.println("B");
      else if (sum >= 50 && sum < 65)              System.out.println("C");
      else if (r >= 50)                            System.out.println("C");
      else                                         System.out.println("D");
    }
  }
}