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

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            }
        }
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            }
        }
    }

} Main public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            }
        }
    } main {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            }
        }
    } boolean first=true; first true try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            }
        } {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            }
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String line; line int i=0 i 0 n=0 n 0 m=0; m 0 int[][] card=null; card null int[] mat=null; mat null while ((line = br.readLine()) != null) {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            } if(line.equals("-1 -1 -1"))break; line.equals("-1 -1 -1") line.equals line "-1 -1 -1" break; String[] str=line.split(" "); str line.split(" ") line.split line " " int a=Integer.parseInt(str[0]); a Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int b=Integer.parseInt(str[1]); b Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int c=Integer.parseInt(str[2]); c Integer.parseInt(str[2]) Integer.parseInt Integer str[2] str 2 if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	} a==-1||b==-1 a==-1 a -1 1 b==-1 b -1 1 {
            		System.out.println("F");
            	} System.out.println("F") System.out.println System.out System System.out "F" if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	} a+b>=80 a+b a b 80 {
            		System.out.println("A");
            	} System.out.println("A") System.out.println System.out System System.out "A" if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	} a+b>=65 a+b a b 65 {
            		System.out.println("B");
            	} System.out.println("B") System.out.println System.out System System.out "B" if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	} a+b>=50 a+b a b 50 {
            		System.out.println("C");
            	} System.out.println("C") System.out.println System.out System System.out "C" if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	} a+b>=30 a+b a b 30 {
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	} if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		} c>=50 c 50 {
            			System.out.println("C");
            		} System.out.println("C") System.out.println System.out System System.out "C" {
            			System.out.println("D");
            		} System.out.println("D") System.out.println System.out System System.out "D" {
            		System.out.println("F");
            	} System.out.println("F") System.out.println System.out System System.out "F" String[] args args public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            }
        }
    }

} public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            }
        }
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(line.equals("-1 -1 -1"))break;
            	String[] str=line.split(" ");
            	int a=Integer.parseInt(str[0]);
            	int b=Integer.parseInt(str[1]);
            	int c=Integer.parseInt(str[2]);
            	if(a==-1||b==-1){
            		System.out.println("F");
            	}else if(a+b>=80){
            		System.out.println("A");
            	}else if(a+b>=65){
            		System.out.println("B");
            	}else if(a+b>=50){
            		System.out.println("C");
            	}else if(a+b>=30){
            		if(c>=50){
            			System.out.println("C");
            		}else{
            			System.out.println("D");
            		}
            	}else{
            		System.out.println("F");
            	}
            }
        }
    }

}