import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    try (Scanner scanner = new Scanner(System.in)) {
      int m, f, r;
      while (true) {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      }
    }
  }
}

class Score {
  private final int midtermExam;
  private final int finalExam;
  private final int reExam;


  Score(int midtermExam, int finalExam, int reExam) {
    this.midtermExam = midtermExam;
    this.finalExam = finalExam;
    this.reExam = reExam;
  }

  private int sumExamScore() {
    return midtermExam + finalExam;
  }

  String score() {
    if (midtermExam == -1 || finalExam == -1) {
      return "F";
    }
    if (sumExamScore() >= 80) {
      return "A";
    }
    if (sumExamScore() >= 65) {
      return "B";
    }
    if (sumExamScore() >= 50) {
      return "C";
    }
    if (sumExamScore() >= 30) {
      if (reExam >= 50) {
        return "C";
      } else {
        return "D";
      }
    }
    return "F";
  }
} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    try (Scanner scanner = new Scanner(System.in)) {
      int m, f, r;
      while (true) {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      }
    }
  }
} Main public static void main(String[] args) {
    try (Scanner scanner = new Scanner(System.in)) {
      int m, f, r;
      while (true) {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      }
    }
  } main {
    try (Scanner scanner = new Scanner(System.in)) {
      int m, f, r;
      while (true) {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      }
    }
  } try (Scanner scanner = new Scanner(System.in)) {
      int m, f, r;
      while (true) {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      }
    } {
      int m, f, r;
      while (true) {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      }
    } Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) int m m f f r; r while (true) {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      } true {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      } m = scanner.nextInt() m scanner.nextInt() scanner.nextInt scanner f = scanner.nextInt() f scanner.nextInt() scanner.nextInt scanner r = scanner.nextInt() r scanner.nextInt() scanner.nextInt scanner 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;
        } return; System.out.println(new Score(m, f, r).score()) System.out.println System.out System System.out new Score(m, f, r).score() new Score(m, f, r).score new Score(m, f, r) String[] args args class Score {
  private final int midtermExam;
  private final int finalExam;
  private final int reExam;


  Score(int midtermExam, int finalExam, int reExam) {
    this.midtermExam = midtermExam;
    this.finalExam = finalExam;
    this.reExam = reExam;
  }

  private int sumExamScore() {
    return midtermExam + finalExam;
  }

  String score() {
    if (midtermExam == -1 || finalExam == -1) {
      return "F";
    }
    if (sumExamScore() >= 80) {
      return "A";
    }
    if (sumExamScore() >= 65) {
      return "B";
    }
    if (sumExamScore() >= 50) {
      return "C";
    }
    if (sumExamScore() >= 30) {
      if (reExam >= 50) {
        return "C";
      } else {
        return "D";
      }
    }
    return "F";
  }
} Score private final int midtermExam; midtermExam private final int finalExam; finalExam private final int reExam; reExam Score(int midtermExam, int finalExam, int reExam) {
    this.midtermExam = midtermExam;
    this.finalExam = finalExam;
    this.reExam = reExam;
  } Score {
    this.midtermExam = midtermExam;
    this.finalExam = finalExam;
    this.reExam = reExam;
  } this.midtermExam = midtermExam this.midtermExam this this.midtermExam midtermExam this.finalExam = finalExam this.finalExam this this.finalExam finalExam this.reExam = reExam this.reExam this this.reExam reExam int midtermExam midtermExam int finalExam finalExam int reExam reExam private int sumExamScore() {
    return midtermExam + finalExam;
  } sumExamScore {
    return midtermExam + finalExam;
  } return midtermExam + finalExam; midtermExam + finalExam midtermExam finalExam String score() {
    if (midtermExam == -1 || finalExam == -1) {
      return "F";
    }
    if (sumExamScore() >= 80) {
      return "A";
    }
    if (sumExamScore() >= 65) {
      return "B";
    }
    if (sumExamScore() >= 50) {
      return "C";
    }
    if (sumExamScore() >= 30) {
      if (reExam >= 50) {
        return "C";
      } else {
        return "D";
      }
    }
    return "F";
  } score {
    if (midtermExam == -1 || finalExam == -1) {
      return "F";
    }
    if (sumExamScore() >= 80) {
      return "A";
    }
    if (sumExamScore() >= 65) {
      return "B";
    }
    if (sumExamScore() >= 50) {
      return "C";
    }
    if (sumExamScore() >= 30) {
      if (reExam >= 50) {
        return "C";
      } else {
        return "D";
      }
    }
    return "F";
  } if (midtermExam == -1 || finalExam == -1) {
      return "F";
    } midtermExam == -1 || finalExam == -1 midtermExam == -1 midtermExam -1 1 finalExam == -1 finalExam -1 1 {
      return "F";
    } return "F"; "F" if (sumExamScore() >= 80) {
      return "A";
    } sumExamScore() >= 80 sumExamScore() sumExamScore 80 {
      return "A";
    } return "A"; "A" if (sumExamScore() >= 65) {
      return "B";
    } sumExamScore() >= 65 sumExamScore() sumExamScore 65 {
      return "B";
    } return "B"; "B" if (sumExamScore() >= 50) {
      return "C";
    } sumExamScore() >= 50 sumExamScore() sumExamScore 50 {
      return "C";
    } return "C"; "C" if (sumExamScore() >= 30) {
      if (reExam >= 50) {
        return "C";
      } else {
        return "D";
      }
    } sumExamScore() >= 30 sumExamScore() sumExamScore 30 {
      if (reExam >= 50) {
        return "C";
      } else {
        return "D";
      }
    } if (reExam >= 50) {
        return "C";
      } else {
        return "D";
      } reExam >= 50 reExam 50 {
        return "C";
      } return "C"; "C" {
        return "D";
      } return "D"; "D" return "F"; "F" public class Main {

  public static void main(String[] args) {
    try (Scanner scanner = new Scanner(System.in)) {
      int m, f, r;
      while (true) {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      }
    }
  }
} public class Main {

  public static void main(String[] args) {
    try (Scanner scanner = new Scanner(System.in)) {
      int m, f, r;
      while (true) {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      }
    }
  }
} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    try (Scanner scanner = new Scanner(System.in)) {
      int m, f, r;
      while (true) {
        m = scanner.nextInt();
        f = scanner.nextInt();
        r = scanner.nextInt();
        if (m == -1 && f == -1 && r == -1) {
          return;
        }
        System.out.println(new Score(m, f, r).score());
      }
    }
  }
}

class Score {
  private final int midtermExam;
  private final int finalExam;
  private final int reExam;


  Score(int midtermExam, int finalExam, int reExam) {
    this.midtermExam = midtermExam;
    this.finalExam = finalExam;
    this.reExam = reExam;
  }

  private int sumExamScore() {
    return midtermExam + finalExam;
  }

  String score() {
    if (midtermExam == -1 || finalExam == -1) {
      return "F";
    }
    if (sumExamScore() >= 80) {
      return "A";
    }
    if (sumExamScore() >= 65) {
      return "B";
    }
    if (sumExamScore() >= 50) {
      return "C";
    }
    if (sumExamScore() >= 30) {
      if (reExam >= 50) {
        return "C";
      } else {
        return "D";
      }
    }
    return "F";
  }
}