import java.util.*;
import java.text.*;
/*
Main class for AOJ where there is no input.
*/
public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int midterm;
      int finalexam;
      int retake;
      int sum;
      char grade;
      
      while(true){
         str = sc.nextLine();
         arr = str.split(" ");
         
         midterm = Integer.parseInt(arr[0]);
         finalexam = Integer.parseInt(arr[1]);
         retake = Integer.parseInt(arr[2]);
         
         sum = midterm + finalexam;
         
         if(midterm == -1 && finalexam == -1 && retake == -1){
            break;
         }
         
         if(midterm == -1 || finalexam == -1){
            grade = 'F';
         }else if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         }
         System.out.println(grade);
      }  
      
   }//main
}//class import java.util.*; util.* java import java.text.*; text.* java public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int midterm;
      int finalexam;
      int retake;
      int sum;
      char grade;
      
      while(true){
         str = sc.nextLine();
         arr = str.split(" ");
         
         midterm = Integer.parseInt(arr[0]);
         finalexam = Integer.parseInt(arr[1]);
         retake = Integer.parseInt(arr[2]);
         
         sum = midterm + finalexam;
         
         if(midterm == -1 && finalexam == -1 && retake == -1){
            break;
         }
         
         if(midterm == -1 || finalexam == -1){
            grade = 'F';
         }else if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         }
         System.out.println(grade);
      }  
      
   }//main
}//class Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int midterm;
      int finalexam;
      int retake;
      int sum;
      char grade;
      
      while(true){
         str = sc.nextLine();
         arr = str.split(" ");
         
         midterm = Integer.parseInt(arr[0]);
         finalexam = Integer.parseInt(arr[1]);
         retake = Integer.parseInt(arr[2]);
         
         sum = midterm + finalexam;
         
         if(midterm == -1 && finalexam == -1 && retake == -1){
            break;
         }
         
         if(midterm == -1 || finalexam == -1){
            grade = 'F';
         }else if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         }
         System.out.println(grade);
      }  
      
   }//main main {
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int midterm;
      int finalexam;
      int retake;
      int sum;
      char grade;
      
      while(true){
         str = sc.nextLine();
         arr = str.split(" ");
         
         midterm = Integer.parseInt(arr[0]);
         finalexam = Integer.parseInt(arr[1]);
         retake = Integer.parseInt(arr[2]);
         
         sum = midterm + finalexam;
         
         if(midterm == -1 && finalexam == -1 && retake == -1){
            break;
         }
         
         if(midterm == -1 || finalexam == -1){
            grade = 'F';
         }else if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         }
         System.out.println(grade);
      }  
      
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str; str String[] arr; arr int midterm; midterm int finalexam; finalexam int retake; retake int sum; sum char grade; grade while(true){
         str = sc.nextLine();
         arr = str.split(" ");
         
         midterm = Integer.parseInt(arr[0]);
         finalexam = Integer.parseInt(arr[1]);
         retake = Integer.parseInt(arr[2]);
         
         sum = midterm + finalexam;
         
         if(midterm == -1 && finalexam == -1 && retake == -1){
            break;
         }
         
         if(midterm == -1 || finalexam == -1){
            grade = 'F';
         }else if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         }
         System.out.println(grade);
      } true {
         str = sc.nextLine();
         arr = str.split(" ");
         
         midterm = Integer.parseInt(arr[0]);
         finalexam = Integer.parseInt(arr[1]);
         retake = Integer.parseInt(arr[2]);
         
         sum = midterm + finalexam;
         
         if(midterm == -1 && finalexam == -1 && retake == -1){
            break;
         }
         
         if(midterm == -1 || finalexam == -1){
            grade = 'F';
         }else if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         }
         System.out.println(grade);
      } str = sc.nextLine() str sc.nextLine() sc.nextLine sc arr = str.split(" ") arr str.split(" ") str.split str " " midterm = Integer.parseInt(arr[0]) midterm Integer.parseInt(arr[0]) Integer.parseInt Integer arr[0] arr 0 finalexam = Integer.parseInt(arr[1]) finalexam Integer.parseInt(arr[1]) Integer.parseInt Integer arr[1] arr 1 retake = Integer.parseInt(arr[2]) retake Integer.parseInt(arr[2]) Integer.parseInt Integer arr[2] arr 2 sum = midterm + finalexam sum midterm + finalexam midterm finalexam if(midterm == -1 && finalexam == -1 && retake == -1){
            break;
         } midterm == -1 && finalexam == -1 && retake == -1 midterm == -1 && finalexam == -1 && retake == -1 midterm == -1 midterm -1 1 finalexam == -1 finalexam -1 1 retake == -1 retake -1 1 {
            break;
         } break; if(midterm == -1 || finalexam == -1){
            grade = 'F';
         }else if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         } midterm == -1 || finalexam == -1 midterm == -1 midterm -1 1 finalexam == -1 finalexam -1 1 {
            grade = 'F';
         } grade = 'F' grade 'F' if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         } sum >= 80 sum 80 {
            grade = 'A';
         } grade = 'A' grade 'A' if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         } sum >= 65 sum 65 {
            grade = 'B';
         } grade = 'B' grade 'B' if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         } sum >= 50 sum 50 {
            grade = 'C';
         } grade = 'C' grade 'C' if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         } sum >= 30 sum 30 {
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         } if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            } retake >= 50 retake 50 {
               grade = 'C';
            } grade = 'C' grade 'C' {
               grade = 'D';
            } grade = 'D' grade 'D' {
            grade = 'F';
         } grade = 'F' grade 'F' System.out.println(grade) System.out.println System.out System System.out grade String[] args args public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int midterm;
      int finalexam;
      int retake;
      int sum;
      char grade;
      
      while(true){
         str = sc.nextLine();
         arr = str.split(" ");
         
         midterm = Integer.parseInt(arr[0]);
         finalexam = Integer.parseInt(arr[1]);
         retake = Integer.parseInt(arr[2]);
         
         sum = midterm + finalexam;
         
         if(midterm == -1 && finalexam == -1 && retake == -1){
            break;
         }
         
         if(midterm == -1 || finalexam == -1){
            grade = 'F';
         }else if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         }
         System.out.println(grade);
      }  
      
   }//main
}//class public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int midterm;
      int finalexam;
      int retake;
      int sum;
      char grade;
      
      while(true){
         str = sc.nextLine();
         arr = str.split(" ");
         
         midterm = Integer.parseInt(arr[0]);
         finalexam = Integer.parseInt(arr[1]);
         retake = Integer.parseInt(arr[2]);
         
         sum = midterm + finalexam;
         
         if(midterm == -1 && finalexam == -1 && retake == -1){
            break;
         }
         
         if(midterm == -1 || finalexam == -1){
            grade = 'F';
         }else if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         }
         System.out.println(grade);
      }  
      
   }//main
}//class Main
import java.util.*;
import java.text.*;
/*
Main class for AOJ where there is no input.
*/
public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int midterm;
      int finalexam;
      int retake;
      int sum;
      char grade;
      
      while(true){
         str = sc.nextLine();
         arr = str.split(" ");
         
         midterm = Integer.parseInt(arr[0]);
         finalexam = Integer.parseInt(arr[1]);
         retake = Integer.parseInt(arr[2]);
         
         sum = midterm + finalexam;
         
         if(midterm == -1 && finalexam == -1 && retake == -1){
            break;
         }
         
         if(midterm == -1 || finalexam == -1){
            grade = 'F';
         }else if(sum >= 80){
            grade = 'A';
         }else if(sum >= 65){
            grade = 'B';
         }else if(sum >= 50){
            grade = 'C';
         }else if(sum >= 30){
            if(retake >= 50){
               grade = 'C';
            }else{
               grade = 'D';
            }
         }else{
            grade = 'F';
         }
         System.out.println(grade);
      }  
      
   }//main
}//class