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