import java.io.*;

class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();

    while(true) {
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int m = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int sum = m + f;

    if(m == -1 && f == -1 && r == -1) {break;}
    else if(m == -1 || f == -1){
      sb.append("F\n");
    }
    else if(sum >= 80){
      sb.append("A\n");
    }
    else if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    }
    }
    System.out.print(sb);
  }
} import java.io.*; io.* java class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();

    while(true) {
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int m = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int sum = m + f;

    if(m == -1 && f == -1 && r == -1) {break;}
    else if(m == -1 || f == -1){
      sb.append("F\n");
    }
    else if(sum >= 80){
      sb.append("A\n");
    }
    else if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    }
    }
    System.out.print(sb);
  }
} Main public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();

    while(true) {
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int m = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int sum = m + f;

    if(m == -1 && f == -1 && r == -1) {break;}
    else if(m == -1 || f == -1){
      sb.append("F\n");
    }
    else if(sum >= 80){
      sb.append("A\n");
    }
    else if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    }
    }
    System.out.print(sb);
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();

    while(true) {
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int m = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int sum = m + f;

    if(m == -1 && f == -1 && r == -1) {break;}
    else if(m == -1 || f == -1){
      sb.append("F\n");
    }
    else if(sum >= 80){
      sb.append("A\n");
    }
    else if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    }
    }
    System.out.print(sb);
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() while(true) {
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int m = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int sum = m + f;

    if(m == -1 && f == -1 && r == -1) {break;}
    else if(m == -1 || f == -1){
      sb.append("F\n");
    }
    else if(sum >= 80){
      sb.append("A\n");
    }
    else if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    }
    } true {
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int m = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int sum = m + f;

    if(m == -1 && f == -1 && r == -1) {break;}
    else if(m == -1 || f == -1){
      sb.append("F\n");
    }
    else if(sum >= 80){
      sb.append("A\n");
    }
    else if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    }
    } String str1 = br.readLine(); str1 br.readLine() br.readLine br String[] str2 = str1.split(" "); str2 str1.split(" ") str1.split str1 " " int m = Integer.parseInt(str2[0]); m Integer.parseInt(str2[0]) Integer.parseInt Integer str2[0] str2 0 int f = Integer.parseInt(str2[1]); f Integer.parseInt(str2[1]) Integer.parseInt Integer str2[1] str2 1 int r = Integer.parseInt(str2[2]); r Integer.parseInt(str2[2]) Integer.parseInt Integer str2[2] str2 2 int sum = m + f; sum m + f m f if(m == -1 && f == -1 && r == -1) {break;}
    else if(m == -1 || f == -1){
      sb.append("F\n");
    }
    else if(sum >= 80){
      sb.append("A\n");
    }
    else if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    } 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;} break; if(m == -1 || f == -1){
      sb.append("F\n");
    }
    else if(sum >= 80){
      sb.append("A\n");
    }
    else if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    } m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
      sb.append("F\n");
    } sb.append("F\n") sb.append sb "F\n" if(sum >= 80){
      sb.append("A\n");
    }
    else if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    } sum >= 80 sum 80 {
      sb.append("A\n");
    } sb.append("A\n") sb.append sb "A\n" if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    } sum >= 65 && sum < 80 sum >= 65 sum 65 sum < 80 sum 80 {
      sb.append("B\n");
    } sb.append("B\n") sb.append sb "B\n" if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    } sum >= 50 && sum < 65 sum >= 50 sum 50 sum < 65 sum 65 {
      sb.append("C\n");
    } sb.append("C\n") sb.append sb "C\n" if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    } sum >= 30 && sum < 50 sum >= 30 sum 30 sum < 50 sum 50 {
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    } if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      } r >= 50 r 50 {
        sb.append("C\n");
      } sb.append("C\n") sb.append sb "C\n" {
        sb.append("D\n");
      } sb.append("D\n") sb.append sb "D\n" if (sum < 30){
      sb.append("F\n");
    } sum < 30 sum 30 {
      sb.append("F\n");
    } sb.append("F\n") sb.append sb "F\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args
import java.io.*;

class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();

    while(true) {
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int m = Integer.parseInt(str2[0]);
    int f = Integer.parseInt(str2[1]);
    int r = Integer.parseInt(str2[2]);
    int sum = m + f;

    if(m == -1 && f == -1 && r == -1) {break;}
    else if(m == -1 || f == -1){
      sb.append("F\n");
    }
    else if(sum >= 80){
      sb.append("A\n");
    }
    else if(sum >= 65 && sum < 80){
      sb.append("B\n");
    }
    else if(sum >= 50 && sum < 65){
      sb.append("C\n");
    }
    else if(sum >= 30 && sum < 50){
      if(r >= 50){
        sb.append("C\n");
      }
      else{
        sb.append("D\n");
      }
    }
    else if (sum < 30){
      sb.append("F\n");
    }
    }
    System.out.print(sb);
  }
}