import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);      
        List<Integer> m = new ArrayList<Integer>();
        List<Integer> f = new ArrayList<Integer>();
        List<Integer> r = new ArrayList<Integer>();
        List<Character> ranks = new ArrayList<Character>();
         
        for (;;) {
            int _m = scan.nextInt();
            int _f = scan.nextInt();
            int _r = scan.nextInt();
             
            if (_m == -1 && _f == -1 && _r == -1) {
                break;
            }
             
            m.add(_m);
            f.add(_f);
            r.add(_r);
        }
 
        for (int i = 0; i < m.size(); i++) {
            char rank;
            int _m = m.get(i);
            int _f = f.get(i);
            int _r = r.get(i);
             
            if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F';
             
            ranks.add(rank);
        }
 
        for (Character character : ranks) {
            System.out.println(character);
        }
         
        scan.close();
    }
 
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
 
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);      
        List<Integer> m = new ArrayList<Integer>();
        List<Integer> f = new ArrayList<Integer>();
        List<Integer> r = new ArrayList<Integer>();
        List<Character> ranks = new ArrayList<Character>();
         
        for (;;) {
            int _m = scan.nextInt();
            int _f = scan.nextInt();
            int _r = scan.nextInt();
             
            if (_m == -1 && _f == -1 && _r == -1) {
                break;
            }
             
            m.add(_m);
            f.add(_f);
            r.add(_r);
        }
 
        for (int i = 0; i < m.size(); i++) {
            char rank;
            int _m = m.get(i);
            int _f = f.get(i);
            int _r = r.get(i);
             
            if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F';
             
            ranks.add(rank);
        }
 
        for (Character character : ranks) {
            System.out.println(character);
        }
         
        scan.close();
    }
 
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);      
        List<Integer> m = new ArrayList<Integer>();
        List<Integer> f = new ArrayList<Integer>();
        List<Integer> r = new ArrayList<Integer>();
        List<Character> ranks = new ArrayList<Character>();
         
        for (;;) {
            int _m = scan.nextInt();
            int _f = scan.nextInt();
            int _r = scan.nextInt();
             
            if (_m == -1 && _f == -1 && _r == -1) {
                break;
            }
             
            m.add(_m);
            f.add(_f);
            r.add(_r);
        }
 
        for (int i = 0; i < m.size(); i++) {
            char rank;
            int _m = m.get(i);
            int _f = f.get(i);
            int _r = r.get(i);
             
            if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F';
             
            ranks.add(rank);
        }
 
        for (Character character : ranks) {
            System.out.println(character);
        }
         
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);      
        List<Integer> m = new ArrayList<Integer>();
        List<Integer> f = new ArrayList<Integer>();
        List<Integer> r = new ArrayList<Integer>();
        List<Character> ranks = new ArrayList<Character>();
         
        for (;;) {
            int _m = scan.nextInt();
            int _f = scan.nextInt();
            int _r = scan.nextInt();
             
            if (_m == -1 && _f == -1 && _r == -1) {
                break;
            }
             
            m.add(_m);
            f.add(_f);
            r.add(_r);
        }
 
        for (int i = 0; i < m.size(); i++) {
            char rank;
            int _m = m.get(i);
            int _f = f.get(i);
            int _r = r.get(i);
             
            if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F';
             
            ranks.add(rank);
        }
 
        for (Character character : ranks) {
            System.out.println(character);
        }
         
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) List<Integer> m = new ArrayList<Integer>(); m new ArrayList<Integer>() List<Integer> f = new ArrayList<Integer>(); f new ArrayList<Integer>() List<Integer> r = new ArrayList<Integer>(); r new ArrayList<Integer>() List<Character> ranks = new ArrayList<Character>(); ranks new ArrayList<Character>() for (;;) {
            int _m = scan.nextInt();
            int _f = scan.nextInt();
            int _r = scan.nextInt();
             
            if (_m == -1 && _f == -1 && _r == -1) {
                break;
            }
             
            m.add(_m);
            f.add(_f);
            r.add(_r);
        } ; {
            int _m = scan.nextInt();
            int _f = scan.nextInt();
            int _r = scan.nextInt();
             
            if (_m == -1 && _f == -1 && _r == -1) {
                break;
            }
             
            m.add(_m);
            f.add(_f);
            r.add(_r);
        } {
            int _m = scan.nextInt();
            int _f = scan.nextInt();
            int _r = scan.nextInt();
             
            if (_m == -1 && _f == -1 && _r == -1) {
                break;
            }
             
            m.add(_m);
            f.add(_f);
            r.add(_r);
        } int _m = scan.nextInt(); _m scan.nextInt() scan.nextInt scan int _f = scan.nextInt(); _f scan.nextInt() scan.nextInt scan int _r = scan.nextInt(); _r scan.nextInt() scan.nextInt scan 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; m.add(_m) m.add m _m f.add(_f) f.add f _f r.add(_r) r.add r _r for (int i = 0; i < m.size(); i++) {
            char rank;
            int _m = m.get(i);
            int _f = f.get(i);
            int _r = r.get(i);
             
            if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F';
             
            ranks.add(rank);
        } int i = 0; int i = 0; i 0 i < m.size() i m.size() m.size m i++ i++ i {
            char rank;
            int _m = m.get(i);
            int _f = f.get(i);
            int _r = r.get(i);
             
            if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F';
             
            ranks.add(rank);
        } {
            char rank;
            int _m = m.get(i);
            int _f = f.get(i);
            int _r = r.get(i);
             
            if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F';
             
            ranks.add(rank);
        } char rank; rank int _m = m.get(i); _m m.get(i) m.get m i int _f = f.get(i); _f f.get(i) f.get f i int _r = r.get(i); _r r.get(i) r.get r i if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F'; _m == -1 || _f == -1 _m == -1 _m -1 1 _f == -1 _f -1 1 rank = 'F' rank 'F' if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F'; _m + _f >= 80 _m + _f _m _f 80 rank = 'A' rank 'A' if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F'; _m + _f >= 65 _m + _f _m _f 65 rank = 'B' rank 'B' if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F'; _m + _f >= 50 _m + _f _m _f 50 rank = 'C' rank 'C' if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F'; _m + _f >= 30 _m + _f _m _f 30 if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D'; _r >= 50 _r 50 rank = 'C' rank 'C' rank = 'D' rank 'D' rank = 'F' rank 'F' ranks.add(rank) ranks.add ranks rank for (Character character : ranks) {
            System.out.println(character);
        } Character character ranks {
            System.out.println(character);
        } {
            System.out.println(character);
        } System.out.println(character) System.out.println System.out System System.out character scan.close() scan.close scan String[] args args public class Main {
 
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);      
        List<Integer> m = new ArrayList<Integer>();
        List<Integer> f = new ArrayList<Integer>();
        List<Integer> r = new ArrayList<Integer>();
        List<Character> ranks = new ArrayList<Character>();
         
        for (;;) {
            int _m = scan.nextInt();
            int _f = scan.nextInt();
            int _r = scan.nextInt();
             
            if (_m == -1 && _f == -1 && _r == -1) {
                break;
            }
             
            m.add(_m);
            f.add(_f);
            r.add(_r);
        }
 
        for (int i = 0; i < m.size(); i++) {
            char rank;
            int _m = m.get(i);
            int _f = f.get(i);
            int _r = r.get(i);
             
            if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F';
             
            ranks.add(rank);
        }
 
        for (Character character : ranks) {
            System.out.println(character);
        }
         
        scan.close();
    }
 
} public class Main {
 
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);      
        List<Integer> m = new ArrayList<Integer>();
        List<Integer> f = new ArrayList<Integer>();
        List<Integer> r = new ArrayList<Integer>();
        List<Character> ranks = new ArrayList<Character>();
         
        for (;;) {
            int _m = scan.nextInt();
            int _f = scan.nextInt();
            int _r = scan.nextInt();
             
            if (_m == -1 && _f == -1 && _r == -1) {
                break;
            }
             
            m.add(_m);
            f.add(_f);
            r.add(_r);
        }
 
        for (int i = 0; i < m.size(); i++) {
            char rank;
            int _m = m.get(i);
            int _f = f.get(i);
            int _r = r.get(i);
             
            if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F';
             
            ranks.add(rank);
        }
 
        for (Character character : ranks) {
            System.out.println(character);
        }
         
        scan.close();
    }
 
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);      
        List<Integer> m = new ArrayList<Integer>();
        List<Integer> f = new ArrayList<Integer>();
        List<Integer> r = new ArrayList<Integer>();
        List<Character> ranks = new ArrayList<Character>();
         
        for (;;) {
            int _m = scan.nextInt();
            int _f = scan.nextInt();
            int _r = scan.nextInt();
             
            if (_m == -1 && _f == -1 && _r == -1) {
                break;
            }
             
            m.add(_m);
            f.add(_f);
            r.add(_r);
        }
 
        for (int i = 0; i < m.size(); i++) {
            char rank;
            int _m = m.get(i);
            int _f = f.get(i);
            int _r = r.get(i);
             
            if (_m == -1 || _f == -1) 
                rank = 'F';
            else if (_m + _f >= 80) 
                rank = 'A';
            else if (_m + _f >= 65) 
                rank = 'B';
            else if (_m + _f >= 50) 
                rank = 'C';
            else if (_m + _f >= 30) 
                if (_r >= 50)
                    rank = 'C';
                else
                    rank = 'D';
            else
                rank = 'F';
             
            ranks.add(rank);
        }
 
        for (Character character : ranks) {
            System.out.println(character);
        }
         
        scan.close();
    }
 
}