import java.util.Scanner;
class Main{
    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int m;
    	int f;
    	int r;
    	int total;
    	int Absent = -1;
    	
    	for(;;){
    		m = scan.nextInt();
    		f = scan.nextInt();
    		r = scan.nextInt();
    		
    		if(m == Absent && f == Absent && r == Absent){
    			break;
    		}
    		
    		if(m == -1 || f == -1){
    			System.out.println("F");
    		}else{
	    		total = m + f;
	    		if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		}
    		}
    	}
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int m;
    	int f;
    	int r;
    	int total;
    	int Absent = -1;
    	
    	for(;;){
    		m = scan.nextInt();
    		f = scan.nextInt();
    		r = scan.nextInt();
    		
    		if(m == Absent && f == Absent && r == Absent){
    			break;
    		}
    		
    		if(m == -1 || f == -1){
    			System.out.println("F");
    		}else{
	    		total = m + f;
	    		if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		}
    		}
    	}
    }
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int m;
    	int f;
    	int r;
    	int total;
    	int Absent = -1;
    	
    	for(;;){
    		m = scan.nextInt();
    		f = scan.nextInt();
    		r = scan.nextInt();
    		
    		if(m == Absent && f == Absent && r == Absent){
    			break;
    		}
    		
    		if(m == -1 || f == -1){
    			System.out.println("F");
    		}else{
	    		total = m + f;
	    		if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		}
    		}
    	}
    } main {
    	Scanner scan = new Scanner(System.in);
    	int m;
    	int f;
    	int r;
    	int total;
    	int Absent = -1;
    	
    	for(;;){
    		m = scan.nextInt();
    		f = scan.nextInt();
    		r = scan.nextInt();
    		
    		if(m == Absent && f == Absent && r == Absent){
    			break;
    		}
    		
    		if(m == -1 || f == -1){
    			System.out.println("F");
    		}else{
	    		total = m + f;
	    		if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		}
    		}
    	}
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int m; m int f; f int r; r int total; total int Absent = -1; Absent -1 1 for(;;){
    		m = scan.nextInt();
    		f = scan.nextInt();
    		r = scan.nextInt();
    		
    		if(m == Absent && f == Absent && r == Absent){
    			break;
    		}
    		
    		if(m == -1 || f == -1){
    			System.out.println("F");
    		}else{
	    		total = m + f;
	    		if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		}
    		}
    	} ; {
    		m = scan.nextInt();
    		f = scan.nextInt();
    		r = scan.nextInt();
    		
    		if(m == Absent && f == Absent && r == Absent){
    			break;
    		}
    		
    		if(m == -1 || f == -1){
    			System.out.println("F");
    		}else{
	    		total = m + f;
	    		if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		}
    		}
    	} {
    		m = scan.nextInt();
    		f = scan.nextInt();
    		r = scan.nextInt();
    		
    		if(m == Absent && f == Absent && r == Absent){
    			break;
    		}
    		
    		if(m == -1 || f == -1){
    			System.out.println("F");
    		}else{
	    		total = m + f;
	    		if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		}
    		}
    	} m = scan.nextInt() m scan.nextInt() scan.nextInt scan f = scan.nextInt() f scan.nextInt() scan.nextInt scan r = scan.nextInt() r scan.nextInt() scan.nextInt scan if(m == Absent && f == Absent && r == Absent){
    			break;
    		} m == Absent && f == Absent && r == Absent m == Absent && f == Absent && r == Absent m == Absent m Absent f == Absent f Absent r == Absent r Absent {
    			break;
    		} break; if(m == -1 || f == -1){
    			System.out.println("F");
    		}else{
	    		total = m + f;
	    		if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		}
    		} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
    			System.out.println("F");
    		} System.out.println("F") System.out.println System.out System System.out "F" {
	    		total = m + f;
	    		if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		}
    		} total = m + f total m + f m f if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		} total >= 80 total 80 {
	    			System.out.println("A");
	    		} System.out.println("A") System.out.println System.out System System.out "A" if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		} total < 80 && total >= 65 total < 80 total 80 total >= 65 total 65 {
	    			System.out.println("B");
	    		} System.out.println("B") System.out.println System.out System System.out "B" if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		} total < 65 && total >= 50 || r >= 50 total < 65 && total >= 50 total < 65 total 65 total >= 50 total 50 r >= 50 r 50 {
	    			System.out.println("C");
	    		} System.out.println("C") System.out.println System.out System System.out "C" if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		} total < 50 && total >= 30 total < 50 total 50 total >= 30 total 30 {
	    			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
import java.util.Scanner;
class Main{
    public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int m;
    	int f;
    	int r;
    	int total;
    	int Absent = -1;
    	
    	for(;;){
    		m = scan.nextInt();
    		f = scan.nextInt();
    		r = scan.nextInt();
    		
    		if(m == Absent && f == Absent && r == Absent){
    			break;
    		}
    		
    		if(m == -1 || f == -1){
    			System.out.println("F");
    		}else{
	    		total = m + f;
	    		if(total >= 80){
	    			System.out.println("A");
	    		}else if(total < 80 && total >= 65){
	    			System.out.println("B");
	    		}else if(total < 65 && total >= 50 || r >= 50){
	    			System.out.println("C");
	    		}else if(total < 50 && total >= 30){
	    			System.out.println("D");
	    		}else{
	    			System.out.println("F");
	    		}
    		}
    	}
    }
}