// ITP1_7_A Grading
import java.io.*;

public class Main {

   public static void main(String[] args) {
      int m = 0, f = 0, r = 0;
      try {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         while (true){
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         }
      }

      catch (Exception e) {
         System.err.println(e);
      }
   }

   private static String judge(int m, int f, int r) {
      if ((m == -1 || f == -1) || m + f < 30)
         return "F";
      else if (m + f < 50) {
         if (r >= 50)
            return "C";
         else
            return "D";
      }
      else if (m + f < 65)
         return "C";
      else if (m + f < 80)
         return "B";
      else
         return "A";
   }
} import java.io.*; io.* java public class Main {

   public static void main(String[] args) {
      int m = 0, f = 0, r = 0;
      try {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         while (true){
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         }
      }

      catch (Exception e) {
         System.err.println(e);
      }
   }

   private static String judge(int m, int f, int r) {
      if ((m == -1 || f == -1) || m + f < 30)
         return "F";
      else if (m + f < 50) {
         if (r >= 50)
            return "C";
         else
            return "D";
      }
      else if (m + f < 65)
         return "C";
      else if (m + f < 80)
         return "B";
      else
         return "A";
   }
} Main public static void main(String[] args) {
      int m = 0, f = 0, r = 0;
      try {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         while (true){
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         }
      }

      catch (Exception e) {
         System.err.println(e);
      }
   } main {
      int m = 0, f = 0, r = 0;
      try {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         while (true){
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         }
      }

      catch (Exception e) {
         System.err.println(e);
      }
   } int m = 0 m 0 f = 0 f 0 r = 0; r 0 try {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         while (true){
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         }
      }

      catch (Exception e) {
         System.err.println(e);
      } catch (Exception e) {
         System.err.println(e);
      } Exception e {
         System.err.println(e);
      } System.err.println(e) System.err.println System.err System System.err e {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         while (true){
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         }
      } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while (true){
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         } true {
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         } String[] strAry = br.readLine().split(" "); strAry br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " m = Integer.parseInt(strAry[0]) m Integer.parseInt(strAry[0]) Integer.parseInt Integer strAry[0] strAry 0 f = Integer.parseInt(strAry[1]) f Integer.parseInt(strAry[1]) Integer.parseInt Integer strAry[1] strAry 1 r = Integer.parseInt(strAry[2]) r Integer.parseInt(strAry[2]) Integer.parseInt Integer strAry[2] strAry 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; System.out.printf("%s\n", judge(m, f, r)) System.out.printf System.out System System.out "%s\n" judge(m, f, r) judge m f r String[] args args private static String judge(int m, int f, int r) {
      if ((m == -1 || f == -1) || m + f < 30)
         return "F";
      else if (m + f < 50) {
         if (r >= 50)
            return "C";
         else
            return "D";
      }
      else if (m + f < 65)
         return "C";
      else if (m + f < 80)
         return "B";
      else
         return "A";
   } judge {
      if ((m == -1 || f == -1) || m + f < 30)
         return "F";
      else if (m + f < 50) {
         if (r >= 50)
            return "C";
         else
            return "D";
      }
      else if (m + f < 65)
         return "C";
      else if (m + f < 80)
         return "B";
      else
         return "A";
   } if ((m == -1 || f == -1) || m + f < 30)
         return "F";
      else if (m + f < 50) {
         if (r >= 50)
            return "C";
         else
            return "D";
      }
      else if (m + f < 65)
         return "C";
      else if (m + f < 80)
         return "B";
      else
         return "A"; (m == -1 || f == -1) || m + f < 30 (m == -1 || f == -1) m == -1 m -1 1 f == -1 f -1 1 m + f < 30 m + f m f 30 return "F"; "F" if (m + f < 50) {
         if (r >= 50)
            return "C";
         else
            return "D";
      }
      else if (m + f < 65)
         return "C";
      else if (m + f < 80)
         return "B";
      else
         return "A"; m + f < 50 m + f m f 50 {
         if (r >= 50)
            return "C";
         else
            return "D";
      } if (r >= 50)
            return "C";
         else
            return "D"; r >= 50 r 50 return "C"; "C" return "D"; "D" if (m + f < 65)
         return "C";
      else if (m + f < 80)
         return "B";
      else
         return "A"; m + f < 65 m + f m f 65 return "C"; "C" if (m + f < 80)
         return "B";
      else
         return "A"; m + f < 80 m + f m f 80 return "B"; "B" return "A"; "A" int m m int f f int r r public class Main {

   public static void main(String[] args) {
      int m = 0, f = 0, r = 0;
      try {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         while (true){
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         }
      }

      catch (Exception e) {
         System.err.println(e);
      }
   }

   private static String judge(int m, int f, int r) {
      if ((m == -1 || f == -1) || m + f < 30)
         return "F";
      else if (m + f < 50) {
         if (r >= 50)
            return "C";
         else
            return "D";
      }
      else if (m + f < 65)
         return "C";
      else if (m + f < 80)
         return "B";
      else
         return "A";
   }
} public class Main {

   public static void main(String[] args) {
      int m = 0, f = 0, r = 0;
      try {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         while (true){
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         }
      }

      catch (Exception e) {
         System.err.println(e);
      }
   }

   private static String judge(int m, int f, int r) {
      if ((m == -1 || f == -1) || m + f < 30)
         return "F";
      else if (m + f < 50) {
         if (r >= 50)
            return "C";
         else
            return "D";
      }
      else if (m + f < 65)
         return "C";
      else if (m + f < 80)
         return "B";
      else
         return "A";
   }
} Main
// ITP1_7_A Grading
import java.io.*;

public class Main {

   public static void main(String[] args) {
      int m = 0, f = 0, r = 0;
      try {
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         while (true){
            String[] strAry = br.readLine().split(" ");
            m = Integer.parseInt(strAry[0]);
            f = Integer.parseInt(strAry[1]);
            r = Integer.parseInt(strAry[2]);

            if (m == -1 && f == -1 && r == -1)  break;

            System.out.printf("%s\n", judge(m, f, r));
         }
      }

      catch (Exception e) {
         System.err.println(e);
      }
   }

   private static String judge(int m, int f, int r) {
      if ((m == -1 || f == -1) || m + f < 30)
         return "F";
      else if (m + f < 50) {
         if (r >= 50)
            return "C";
         else
            return "D";
      }
      else if (m + f < 65)
         return "C";
      else if (m + f < 80)
         return "B";
      else
         return "A";
   }
}