/* ITP1_7_A */
import java.io.*;

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

      while(true){
        // input
        String[] score = br.readLine().split(" ");
        int mid_exam = Integer.parseInt(score[0]);
        int fin_exam = Integer.parseInt(score[1]);
        int retest = Integer.parseInt(score[2]);
        // errorcheck
        if(mid_exam < -1 || mid_exam > 50) return;
        if(fin_exam < -1 || fin_exam > 50) return;
        if(retest < -1 || retest > 100) return;
        // finish
        if(mid_exam == -1 && fin_exam == -1 && retest == -1) break;

        int mid_fin = mid_exam + fin_exam;
        // grading
        if(mid_exam == -1 || fin_exam == -1){
          sb.append("F\n");
          continue;
        }
        if(mid_fin >= 80){
          sb.append("A\n");

        }else if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        }
      }
      // output
      System.out.print(sb);
    }catch(Exception e){
      System.out.println(e);
    }
  }
} import java.io.*; io.* java class Main
{
  public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      while(true){
        // input
        String[] score = br.readLine().split(" ");
        int mid_exam = Integer.parseInt(score[0]);
        int fin_exam = Integer.parseInt(score[1]);
        int retest = Integer.parseInt(score[2]);
        // errorcheck
        if(mid_exam < -1 || mid_exam > 50) return;
        if(fin_exam < -1 || fin_exam > 50) return;
        if(retest < -1 || retest > 100) return;
        // finish
        if(mid_exam == -1 && fin_exam == -1 && retest == -1) break;

        int mid_fin = mid_exam + fin_exam;
        // grading
        if(mid_exam == -1 || fin_exam == -1){
          sb.append("F\n");
          continue;
        }
        if(mid_fin >= 80){
          sb.append("A\n");

        }else if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        }
      }
      // output
      System.out.print(sb);
    }catch(Exception e){
      System.out.println(e);
    }
  }
} Main public static void main(String[] args)
  {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      while(true){
        // input
        String[] score = br.readLine().split(" ");
        int mid_exam = Integer.parseInt(score[0]);
        int fin_exam = Integer.parseInt(score[1]);
        int retest = Integer.parseInt(score[2]);
        // errorcheck
        if(mid_exam < -1 || mid_exam > 50) return;
        if(fin_exam < -1 || fin_exam > 50) return;
        if(retest < -1 || retest > 100) return;
        // finish
        if(mid_exam == -1 && fin_exam == -1 && retest == -1) break;

        int mid_fin = mid_exam + fin_exam;
        // grading
        if(mid_exam == -1 || fin_exam == -1){
          sb.append("F\n");
          continue;
        }
        if(mid_fin >= 80){
          sb.append("A\n");

        }else if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        }
      }
      // output
      System.out.print(sb);
    }catch(Exception e){
      System.out.println(e);
    }
  } main {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      while(true){
        // input
        String[] score = br.readLine().split(" ");
        int mid_exam = Integer.parseInt(score[0]);
        int fin_exam = Integer.parseInt(score[1]);
        int retest = Integer.parseInt(score[2]);
        // errorcheck
        if(mid_exam < -1 || mid_exam > 50) return;
        if(fin_exam < -1 || fin_exam > 50) return;
        if(retest < -1 || retest > 100) return;
        // finish
        if(mid_exam == -1 && fin_exam == -1 && retest == -1) break;

        int mid_fin = mid_exam + fin_exam;
        // grading
        if(mid_exam == -1 || fin_exam == -1){
          sb.append("F\n");
          continue;
        }
        if(mid_fin >= 80){
          sb.append("A\n");

        }else if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        }
      }
      // output
      System.out.print(sb);
    }catch(Exception e){
      System.out.println(e);
    }
  } try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      while(true){
        // input
        String[] score = br.readLine().split(" ");
        int mid_exam = Integer.parseInt(score[0]);
        int fin_exam = Integer.parseInt(score[1]);
        int retest = Integer.parseInt(score[2]);
        // errorcheck
        if(mid_exam < -1 || mid_exam > 50) return;
        if(fin_exam < -1 || fin_exam > 50) return;
        if(retest < -1 || retest > 100) return;
        // finish
        if(mid_exam == -1 && fin_exam == -1 && retest == -1) break;

        int mid_fin = mid_exam + fin_exam;
        // grading
        if(mid_exam == -1 || fin_exam == -1){
          sb.append("F\n");
          continue;
        }
        if(mid_fin >= 80){
          sb.append("A\n");

        }else if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        }
      }
      // output
      System.out.print(sb);
    }catch(Exception e){
      System.out.println(e);
    } catch(Exception e){
      System.out.println(e);
    } Exception e {
      System.out.println(e);
    } System.out.println(e) System.out.println System.out System System.out e {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringBuilder sb = new StringBuilder();

      while(true){
        // input
        String[] score = br.readLine().split(" ");
        int mid_exam = Integer.parseInt(score[0]);
        int fin_exam = Integer.parseInt(score[1]);
        int retest = Integer.parseInt(score[2]);
        // errorcheck
        if(mid_exam < -1 || mid_exam > 50) return;
        if(fin_exam < -1 || fin_exam > 50) return;
        if(retest < -1 || retest > 100) return;
        // finish
        if(mid_exam == -1 && fin_exam == -1 && retest == -1) break;

        int mid_fin = mid_exam + fin_exam;
        // grading
        if(mid_exam == -1 || fin_exam == -1){
          sb.append("F\n");
          continue;
        }
        if(mid_fin >= 80){
          sb.append("A\n");

        }else if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        }
      }
      // output
      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){
        // input
        String[] score = br.readLine().split(" ");
        int mid_exam = Integer.parseInt(score[0]);
        int fin_exam = Integer.parseInt(score[1]);
        int retest = Integer.parseInt(score[2]);
        // errorcheck
        if(mid_exam < -1 || mid_exam > 50) return;
        if(fin_exam < -1 || fin_exam > 50) return;
        if(retest < -1 || retest > 100) return;
        // finish
        if(mid_exam == -1 && fin_exam == -1 && retest == -1) break;

        int mid_fin = mid_exam + fin_exam;
        // grading
        if(mid_exam == -1 || fin_exam == -1){
          sb.append("F\n");
          continue;
        }
        if(mid_fin >= 80){
          sb.append("A\n");

        }else if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        }
      } true {
        // input
        String[] score = br.readLine().split(" ");
        int mid_exam = Integer.parseInt(score[0]);
        int fin_exam = Integer.parseInt(score[1]);
        int retest = Integer.parseInt(score[2]);
        // errorcheck
        if(mid_exam < -1 || mid_exam > 50) return;
        if(fin_exam < -1 || fin_exam > 50) return;
        if(retest < -1 || retest > 100) return;
        // finish
        if(mid_exam == -1 && fin_exam == -1 && retest == -1) break;

        int mid_fin = mid_exam + fin_exam;
        // grading
        if(mid_exam == -1 || fin_exam == -1){
          sb.append("F\n");
          continue;
        }
        if(mid_fin >= 80){
          sb.append("A\n");

        }else if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        }
      } String[] score = br.readLine().split(" "); score br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int mid_exam = Integer.parseInt(score[0]); mid_exam Integer.parseInt(score[0]) Integer.parseInt Integer score[0] score 0 int fin_exam = Integer.parseInt(score[1]); fin_exam Integer.parseInt(score[1]) Integer.parseInt Integer score[1] score 1 int retest = Integer.parseInt(score[2]); retest Integer.parseInt(score[2]) Integer.parseInt Integer score[2] score 2 if(mid_exam < -1 || mid_exam > 50) return; mid_exam < -1 || mid_exam > 50 mid_exam < -1 mid_exam -1 1 mid_exam > 50 mid_exam 50 return; if(fin_exam < -1 || fin_exam > 50) return; fin_exam < -1 || fin_exam > 50 fin_exam < -1 fin_exam -1 1 fin_exam > 50 fin_exam 50 return; if(retest < -1 || retest > 100) return; retest < -1 || retest > 100 retest < -1 retest -1 1 retest > 100 retest 100 return; if(mid_exam == -1 && fin_exam == -1 && retest == -1) break; mid_exam == -1 && fin_exam == -1 && retest == -1 mid_exam == -1 && fin_exam == -1 && retest == -1 mid_exam == -1 mid_exam -1 1 fin_exam == -1 fin_exam -1 1 retest == -1 retest -1 1 break; int mid_fin = mid_exam + fin_exam; mid_fin mid_exam + fin_exam mid_exam fin_exam if(mid_exam == -1 || fin_exam == -1){
          sb.append("F\n");
          continue;
        } mid_exam == -1 || fin_exam == -1 mid_exam == -1 mid_exam -1 1 fin_exam == -1 fin_exam -1 1 {
          sb.append("F\n");
          continue;
        } sb.append("F\n") sb.append sb "F\n" continue; if(mid_fin >= 80){
          sb.append("A\n");

        }else if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        } mid_fin >= 80 mid_fin 80 {
          sb.append("A\n");

        } sb.append("A\n") sb.append sb "A\n" if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        } mid_fin >= 65 mid_fin 65 {
          sb.append("B\n");

        } sb.append("B\n") sb.append sb "B\n" if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        } mid_fin >= 50 mid_fin 50 {
          sb.append("C\n");

        } sb.append("C\n") sb.append sb "C\n" if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        } mid_fin >= 30 mid_fin 30 {
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        } if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          } retest >= 50 retest 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" {
          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
/* ITP1_7_A */
import java.io.*;

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

      while(true){
        // input
        String[] score = br.readLine().split(" ");
        int mid_exam = Integer.parseInt(score[0]);
        int fin_exam = Integer.parseInt(score[1]);
        int retest = Integer.parseInt(score[2]);
        // errorcheck
        if(mid_exam < -1 || mid_exam > 50) return;
        if(fin_exam < -1 || fin_exam > 50) return;
        if(retest < -1 || retest > 100) return;
        // finish
        if(mid_exam == -1 && fin_exam == -1 && retest == -1) break;

        int mid_fin = mid_exam + fin_exam;
        // grading
        if(mid_exam == -1 || fin_exam == -1){
          sb.append("F\n");
          continue;
        }
        if(mid_fin >= 80){
          sb.append("A\n");

        }else if(mid_fin >= 65){
          sb.append("B\n");

        }else if(mid_fin >= 50){
          sb.append("C\n");

        }else if(mid_fin >= 30){
          if(retest >= 50){
            sb.append("C\n");
          }else{
            sb.append("D\n");
          }

        }else{
          sb.append("F\n");
        }
      }
      // output
      System.out.print(sb);
    }catch(Exception e){
      System.out.println(e);
    }
  }
}