import java.io.*;
class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader  br=new BufferedReader(new InputStreamReader(System.in));
    boolean i=true;
    while(i){
      String str=br.readLine();
      String[] data=str.split(" ");
      int m=Integer.parseInt(data[0]);
      int f=Integer.parseInt(data[1]);
      int r=Integer.parseInt(data[2]);
      if(m==-1 && f==-1 && r==-1){
        i=false;
      }else if(m!=-1 && f!=-1){
          int score= m + f;
          if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F");
      }else     System.out.println("F");
    }
    br.close();
}
} import java.io.*; io.* java class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader  br=new BufferedReader(new InputStreamReader(System.in));
    boolean i=true;
    while(i){
      String str=br.readLine();
      String[] data=str.split(" ");
      int m=Integer.parseInt(data[0]);
      int f=Integer.parseInt(data[1]);
      int r=Integer.parseInt(data[2]);
      if(m==-1 && f==-1 && r==-1){
        i=false;
      }else if(m!=-1 && f!=-1){
          int score= m + f;
          if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F");
      }else     System.out.println("F");
    }
    br.close();
}
} Main public static void main(String[] args)throws IOException{
    BufferedReader  br=new BufferedReader(new InputStreamReader(System.in));
    boolean i=true;
    while(i){
      String str=br.readLine();
      String[] data=str.split(" ");
      int m=Integer.parseInt(data[0]);
      int f=Integer.parseInt(data[1]);
      int r=Integer.parseInt(data[2]);
      if(m==-1 && f==-1 && r==-1){
        i=false;
      }else if(m!=-1 && f!=-1){
          int score= m + f;
          if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F");
      }else     System.out.println("F");
    }
    br.close();
} main {
    BufferedReader  br=new BufferedReader(new InputStreamReader(System.in));
    boolean i=true;
    while(i){
      String str=br.readLine();
      String[] data=str.split(" ");
      int m=Integer.parseInt(data[0]);
      int f=Integer.parseInt(data[1]);
      int r=Integer.parseInt(data[2]);
      if(m==-1 && f==-1 && r==-1){
        i=false;
      }else if(m!=-1 && f!=-1){
          int score= m + f;
          if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F");
      }else     System.out.println("F");
    }
    br.close();
} BufferedReader  br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) boolean i=true; i true while(i){
      String str=br.readLine();
      String[] data=str.split(" ");
      int m=Integer.parseInt(data[0]);
      int f=Integer.parseInt(data[1]);
      int r=Integer.parseInt(data[2]);
      if(m==-1 && f==-1 && r==-1){
        i=false;
      }else if(m!=-1 && f!=-1){
          int score= m + f;
          if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F");
      }else     System.out.println("F");
    } i {
      String str=br.readLine();
      String[] data=str.split(" ");
      int m=Integer.parseInt(data[0]);
      int f=Integer.parseInt(data[1]);
      int r=Integer.parseInt(data[2]);
      if(m==-1 && f==-1 && r==-1){
        i=false;
      }else if(m!=-1 && f!=-1){
          int score= m + f;
          if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F");
      }else     System.out.println("F");
    } String str=br.readLine(); str br.readLine() br.readLine br String[] data=str.split(" "); data str.split(" ") str.split str " " int m=Integer.parseInt(data[0]); m Integer.parseInt(data[0]) Integer.parseInt Integer data[0] data 0 int f=Integer.parseInt(data[1]); f Integer.parseInt(data[1]) Integer.parseInt Integer data[1] data 1 int r=Integer.parseInt(data[2]); r Integer.parseInt(data[2]) Integer.parseInt Integer data[2] data 2 if(m==-1 && f==-1 && r==-1){
        i=false;
      }else if(m!=-1 && f!=-1){
          int score= m + f;
          if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F");
      }else     System.out.println("F"); 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 {
        i=false;
      } i=false i false if(m!=-1 && f!=-1){
          int score= m + f;
          if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F");
      }else     System.out.println("F"); m!=-1 && f!=-1 m!=-1 m -1 1 f!=-1 f -1 1 {
          int score= m + f;
          if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F");
      } int score= m + f; score m + f m f if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F"); score >=80 score 80 System.out.println("A") System.out.println System.out System System.out "A" if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F"); score >=65 score 65 System.out.println("B") System.out.println System.out System System.out "B" if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F"); score >=50 score 50 System.out.println("C") System.out.println System.out System System.out "C" if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F"); score >=30 score 30 {
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          } 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" System.out.println("F") System.out.println System.out System System.out "F" System.out.println("F") System.out.println System.out System System.out "F" br.close() br.close br String[] args args
import java.io.*;
class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader  br=new BufferedReader(new InputStreamReader(System.in));
    boolean i=true;
    while(i){
      String str=br.readLine();
      String[] data=str.split(" ");
      int m=Integer.parseInt(data[0]);
      int f=Integer.parseInt(data[1]);
      int r=Integer.parseInt(data[2]);
      if(m==-1 && f==-1 && r==-1){
        i=false;
      }else if(m!=-1 && f!=-1){
          int score= m + f;
          if(score >=80)  System.out.println("A");
          else if(score >=65)  System.out.println("B");
          else if(score >=50)  System.out.println("C");
          else if(score >=30){
              if(r >=50)  System.out.println("C");
              else  System.out.println("D");
          }else   System.out.println("F");
      }else     System.out.println("F");
    }
    br.close();
}
}