import java.util.*;

class Main {
  public static void main(String args[]) {
    // (??????????¨?) (??????????¨?) (???????¨?)
    Scanner scanner = new Scanner(System.in);
    while (true) {
      String gradeString = scanner.nextLine();
      if (gradeString.equals("-1 -1 -1")) {
        break;
      }
      String[] gradeStrArr = gradeString.split(" ");
      int[] gradeIntArr = new int[3];
      for (int i = 0; i < 3; i++) {
        gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]);
      }
      System.out.println(judge(gradeIntArr));
    }
  }
  static String judge(int[] scores) {
    String ans = "";
    int sum = scores[0] + scores[1];
    if (scores[0] == -1 || scores[1] == -1) {
      ans = "F";
    } else if (sum >= 80) {
      ans = "A";
    } else if (sum >= 65) {
      ans = "B";
    } else if (sum >= 50) {
      ans = "C";
    } else if (sum >= 30 && scores[2] >= 50) {
      ans = "C";
    } else if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    }
    return ans;
  }
} import java.util.*; util.* java class Main {
  public static void main(String args[]) {
    // (??????????¨?) (??????????¨?) (???????¨?)
    Scanner scanner = new Scanner(System.in);
    while (true) {
      String gradeString = scanner.nextLine();
      if (gradeString.equals("-1 -1 -1")) {
        break;
      }
      String[] gradeStrArr = gradeString.split(" ");
      int[] gradeIntArr = new int[3];
      for (int i = 0; i < 3; i++) {
        gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]);
      }
      System.out.println(judge(gradeIntArr));
    }
  }
  static String judge(int[] scores) {
    String ans = "";
    int sum = scores[0] + scores[1];
    if (scores[0] == -1 || scores[1] == -1) {
      ans = "F";
    } else if (sum >= 80) {
      ans = "A";
    } else if (sum >= 65) {
      ans = "B";
    } else if (sum >= 50) {
      ans = "C";
    } else if (sum >= 30 && scores[2] >= 50) {
      ans = "C";
    } else if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    }
    return ans;
  }
} Main public static void main(String args[]) {
    // (??????????¨?) (??????????¨?) (???????¨?)
    Scanner scanner = new Scanner(System.in);
    while (true) {
      String gradeString = scanner.nextLine();
      if (gradeString.equals("-1 -1 -1")) {
        break;
      }
      String[] gradeStrArr = gradeString.split(" ");
      int[] gradeIntArr = new int[3];
      for (int i = 0; i < 3; i++) {
        gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]);
      }
      System.out.println(judge(gradeIntArr));
    }
  } main {
    // (??????????¨?) (??????????¨?) (???????¨?)
    Scanner scanner = new Scanner(System.in);
    while (true) {
      String gradeString = scanner.nextLine();
      if (gradeString.equals("-1 -1 -1")) {
        break;
      }
      String[] gradeStrArr = gradeString.split(" ");
      int[] gradeIntArr = new int[3];
      for (int i = 0; i < 3; i++) {
        gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]);
      }
      System.out.println(judge(gradeIntArr));
    }
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) while (true) {
      String gradeString = scanner.nextLine();
      if (gradeString.equals("-1 -1 -1")) {
        break;
      }
      String[] gradeStrArr = gradeString.split(" ");
      int[] gradeIntArr = new int[3];
      for (int i = 0; i < 3; i++) {
        gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]);
      }
      System.out.println(judge(gradeIntArr));
    } true {
      String gradeString = scanner.nextLine();
      if (gradeString.equals("-1 -1 -1")) {
        break;
      }
      String[] gradeStrArr = gradeString.split(" ");
      int[] gradeIntArr = new int[3];
      for (int i = 0; i < 3; i++) {
        gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]);
      }
      System.out.println(judge(gradeIntArr));
    } String gradeString = scanner.nextLine(); gradeString scanner.nextLine() scanner.nextLine scanner if (gradeString.equals("-1 -1 -1")) {
        break;
      } gradeString.equals("-1 -1 -1") gradeString.equals gradeString "-1 -1 -1" {
        break;
      } break; String[] gradeStrArr = gradeString.split(" "); gradeStrArr gradeString.split(" ") gradeString.split gradeString " " int[] gradeIntArr = new int[3]; gradeIntArr new int[3] 3 for (int i = 0; i < 3; i++) {
        gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]);
      } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
        gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]);
      } {
        gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]);
      } gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]) gradeIntArr[i] gradeIntArr i Integer.parseInt(gradeStrArr[i]) Integer.parseInt Integer gradeStrArr[i] gradeStrArr i System.out.println(judge(gradeIntArr)) System.out.println System.out System System.out judge(gradeIntArr) judge gradeIntArr String args[] args static String judge(int[] scores) {
    String ans = "";
    int sum = scores[0] + scores[1];
    if (scores[0] == -1 || scores[1] == -1) {
      ans = "F";
    } else if (sum >= 80) {
      ans = "A";
    } else if (sum >= 65) {
      ans = "B";
    } else if (sum >= 50) {
      ans = "C";
    } else if (sum >= 30 && scores[2] >= 50) {
      ans = "C";
    } else if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    }
    return ans;
  } judge {
    String ans = "";
    int sum = scores[0] + scores[1];
    if (scores[0] == -1 || scores[1] == -1) {
      ans = "F";
    } else if (sum >= 80) {
      ans = "A";
    } else if (sum >= 65) {
      ans = "B";
    } else if (sum >= 50) {
      ans = "C";
    } else if (sum >= 30 && scores[2] >= 50) {
      ans = "C";
    } else if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    }
    return ans;
  } String ans = ""; ans "" int sum = scores[0] + scores[1]; sum scores[0] + scores[1] scores[0] scores 0 scores[1] scores 1 if (scores[0] == -1 || scores[1] == -1) {
      ans = "F";
    } else if (sum >= 80) {
      ans = "A";
    } else if (sum >= 65) {
      ans = "B";
    } else if (sum >= 50) {
      ans = "C";
    } else if (sum >= 30 && scores[2] >= 50) {
      ans = "C";
    } else if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    } scores[0] == -1 || scores[1] == -1 scores[0] == -1 scores[0] scores 0 -1 1 scores[1] == -1 scores[1] scores 1 -1 1 {
      ans = "F";
    } ans = "F" ans "F" if (sum >= 80) {
      ans = "A";
    } else if (sum >= 65) {
      ans = "B";
    } else if (sum >= 50) {
      ans = "C";
    } else if (sum >= 30 && scores[2] >= 50) {
      ans = "C";
    } else if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    } sum >= 80 sum 80 {
      ans = "A";
    } ans = "A" ans "A" if (sum >= 65) {
      ans = "B";
    } else if (sum >= 50) {
      ans = "C";
    } else if (sum >= 30 && scores[2] >= 50) {
      ans = "C";
    } else if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    } sum >= 65 sum 65 {
      ans = "B";
    } ans = "B" ans "B" if (sum >= 50) {
      ans = "C";
    } else if (sum >= 30 && scores[2] >= 50) {
      ans = "C";
    } else if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    } sum >= 50 sum 50 {
      ans = "C";
    } ans = "C" ans "C" if (sum >= 30 && scores[2] >= 50) {
      ans = "C";
    } else if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    } sum >= 30 && scores[2] >= 50 sum >= 30 sum 30 scores[2] >= 50 scores[2] scores 2 50 {
      ans = "C";
    } ans = "C" ans "C" if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    } sum >= 30 sum 30 {
      ans = "D";
    } ans = "D" ans "D" if (sum < 30) {
      ans = "F";
    } sum < 30 sum 30 {
      ans = "F";
    } ans = "F" ans "F" return ans; ans int[] scores scores
import java.util.*;

class Main {
  public static void main(String args[]) {
    // (??????????¨?) (??????????¨?) (???????¨?)
    Scanner scanner = new Scanner(System.in);
    while (true) {
      String gradeString = scanner.nextLine();
      if (gradeString.equals("-1 -1 -1")) {
        break;
      }
      String[] gradeStrArr = gradeString.split(" ");
      int[] gradeIntArr = new int[3];
      for (int i = 0; i < 3; i++) {
        gradeIntArr[i] = Integer.parseInt(gradeStrArr[i]);
      }
      System.out.println(judge(gradeIntArr));
    }
  }
  static String judge(int[] scores) {
    String ans = "";
    int sum = scores[0] + scores[1];
    if (scores[0] == -1 || scores[1] == -1) {
      ans = "F";
    } else if (sum >= 80) {
      ans = "A";
    } else if (sum >= 65) {
      ans = "B";
    } else if (sum >= 50) {
      ans = "C";
    } else if (sum >= 30 && scores[2] >= 50) {
      ans = "C";
    } else if (sum >= 30) {
      ans = "D";
    } else if (sum < 30) {
      ans = "F";
    }
    return ans;
  }
}