import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_7_A
 * 
 * @author chrone
 * 
 */
public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(
                    new InputStreamReader(System.in));
            
            String sStr;
            while ((sStr = stdReader.readLine()) != null) {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            }

            stdReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(
                    new InputStreamReader(System.in));
            
            String sStr;
            while ((sStr = stdReader.readLine()) != null) {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            }

            stdReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
    }
} Main public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(
                    new InputStreamReader(System.in));
            
            String sStr;
            while ((sStr = stdReader.readLine()) != null) {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            }

            stdReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
    } main {
        try {
            BufferedReader stdReader = new BufferedReader(
                    new InputStreamReader(System.in));
            
            String sStr;
            while ((sStr = stdReader.readLine()) != null) {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            }

            stdReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
    } try {
            BufferedReader stdReader = new BufferedReader(
                    new InputStreamReader(System.in));
            
            String sStr;
            while ((sStr = stdReader.readLine()) != null) {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            }

            stdReader.close();
        } catch (Exception e) {
            System.exit(-1);
        } catch (Exception e) {
            System.exit(-1);
        } Exception e {
            System.exit(-1);
        } System.exit(-1) System.exit System -1 1 {
            BufferedReader stdReader = new BufferedReader(
                    new InputStreamReader(System.in));
            
            String sStr;
            while ((sStr = stdReader.readLine()) != null) {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            }

            stdReader.close();
        } BufferedReader stdReader = new BufferedReader(
                    new InputStreamReader(System.in)); stdReader new BufferedReader(
                    new InputStreamReader(System.in)) String sStr; sStr while ((sStr = stdReader.readLine()) != null) {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            } (sStr = stdReader.readLine()) != null (sStr = stdReader.readLine()) sStr stdReader.readLine() stdReader.readLine stdReader null {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            } String[] inputs = sStr.split(" "); inputs sStr.split(" ") sStr.split sStr " " int m = Integer.valueOf(inputs[0]); m Integer.valueOf(inputs[0]) Integer.valueOf Integer inputs[0] inputs 0 int f   = Integer.valueOf(inputs[1]); f Integer.valueOf(inputs[1]) Integer.valueOf Integer inputs[1] inputs 1 int r   = Integer.valueOf(inputs[2]); r Integer.valueOf(inputs[2]) Integer.valueOf Integer inputs[2] inputs 2 if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                } 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;
                    // nothing to do.
                } break; if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                } m==-1 || f == -1 || (m+f <30) m==-1 || f == -1 || (m+f <30) m==-1 m -1 1 f == -1 f -1 1 (m+f <30) m+f m f 30 {
                    // F
                    System.out.print("F");
                } System.out.print("F") System.out.print System.out System System.out "F" if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                } m+f >= 80 m+f m f 80 {
                    // A
                    System.out.print("A");
                } System.out.print("A") System.out.print System.out System System.out "A" if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                } m+f < 80 && m+f >=65 m+f < 80 m+f m f 80 m+f >=65 m+f m f 65 {
                    // B
                    System.out.print("B");
                } System.out.print("B") System.out.print System.out System System.out "B" if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                } (m+f >=50 && m+f < 65) || r>=50 (m+f >=50 && m+f < 65) m+f >=50 m+f m f 50 m+f < 65 m+f m f 65 r>=50 r 50 {
                    // C
                    System.out.print("C");
                } System.out.print("C") System.out.print System.out System System.out "C" if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                } m+f>=30 && m+f<50 m+f>=30 m+f m f 30 m+f<50 m+f m f 50 {
                    // D
                    System.out.print("D");
                } System.out.print("D") System.out.print System.out System System.out "D" if (m+f<30) {
                    // F
                    System.out.print("F");
                } m+f<30 m+f m f 30 {
                    // F
                    System.out.print("F");
                } System.out.print("F") System.out.print System.out System System.out "F" System.out.println() System.out.println System.out System System.out stdReader.close() stdReader.close stdReader String[] args args public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(
                    new InputStreamReader(System.in));
            
            String sStr;
            while ((sStr = stdReader.readLine()) != null) {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            }

            stdReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(
                    new InputStreamReader(System.in));
            
            String sStr;
            while ((sStr = stdReader.readLine()) != null) {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            }

            stdReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_7_A
 * 
 * @author chrone
 * 
 */
public class Main {
    public static void main(String[] args) {
        try {
            BufferedReader stdReader = new BufferedReader(
                    new InputStreamReader(System.in));
            
            String sStr;
            while ((sStr = stdReader.readLine()) != null) {
                String[] inputs = sStr.split(" ");
                
                int m = Integer.valueOf(inputs[0]);
                int f   = Integer.valueOf(inputs[1]);
                int r   = Integer.valueOf(inputs[2]);
                
                if (m == -1 && f == -1 && r == -1) {
                    break;
                    // nothing to do.
                }
                
                if (m==-1 || f == -1 || (m+f <30)) {
                    // F
                    System.out.print("F");
                } else if ( m+f >= 80) {
                    // A
                    System.out.print("A");
                } else if  (m+f < 80 && m+f >=65) {
                    // B
                    System.out.print("B");
                } else if ( (m+f >=50 && m+f < 65) || r>=50) {
                    // C
                    System.out.print("C");
                } else if (m+f>=30 && m+f<50) {
                    // D
                    System.out.print("D");
                } else if (m+f<30) {
                    // F
                    System.out.print("F");
                }
                System.out.println();
            }

            stdReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
    }
}