import java.util.Scanner;

class Run{
	public int m = 50;
	public int e = 50;
	public int r = 100;
}
	

class Main {
  public static void main(String args[]) {
	  	Scanner scanner = new Scanner(System.in);
	  	int sum;
	  	String gra;
	  	
	  	Run runs = new Run();
	  	
	  	while(true) {
	  		runs.m = scanner.nextInt();
	  		runs.e = scanner.nextInt();
	  		runs.r = scanner.nextInt();
		  	
		  	if( runs.m == -1 && runs.e == -1 && runs.r == -1 )
		  		break;
		  	
	  		sum = runs.m + runs.e;
	  		
	  		
		  	if(sum >= 80)
		  		gra = "A";
		  	else if( sum >= 65 )
		  		gra = "B";
		  	else if( sum >= 50)
		  		gra = "C";
		  	else if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F";
		  		
		  	if( runs.m == -1 || runs.e == -1 )
		  		gra = "F";
		  	
		  	switch(gra){
		  	case "A":
		  		System.out.println("A");
		  		break;
		  	case "B":
		  		System.out.println("B");
		  		break;
		  	case "C":
		  		System.out.println("C");
		  		break;
		  	case "D":
		  		System.out.println("D");
		  		break;
		  	case "F":
		  		System.out.println("F");
		  	}
		  	
  		}
        scanner.close();
  }
} import java.util.Scanner; Scanner java.util class Run{
	public int m = 50;
	public int e = 50;
	public int r = 100;
} Run public int m = 50; m 50 public int e = 50; e 50 public int r = 100; r 100 class Main {
  public static void main(String args[]) {
	  	Scanner scanner = new Scanner(System.in);
	  	int sum;
	  	String gra;
	  	
	  	Run runs = new Run();
	  	
	  	while(true) {
	  		runs.m = scanner.nextInt();
	  		runs.e = scanner.nextInt();
	  		runs.r = scanner.nextInt();
		  	
		  	if( runs.m == -1 && runs.e == -1 && runs.r == -1 )
		  		break;
		  	
	  		sum = runs.m + runs.e;
	  		
	  		
		  	if(sum >= 80)
		  		gra = "A";
		  	else if( sum >= 65 )
		  		gra = "B";
		  	else if( sum >= 50)
		  		gra = "C";
		  	else if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F";
		  		
		  	if( runs.m == -1 || runs.e == -1 )
		  		gra = "F";
		  	
		  	switch(gra){
		  	case "A":
		  		System.out.println("A");
		  		break;
		  	case "B":
		  		System.out.println("B");
		  		break;
		  	case "C":
		  		System.out.println("C");
		  		break;
		  	case "D":
		  		System.out.println("D");
		  		break;
		  	case "F":
		  		System.out.println("F");
		  	}
		  	
  		}
        scanner.close();
  }
} Main public static void main(String args[]) {
	  	Scanner scanner = new Scanner(System.in);
	  	int sum;
	  	String gra;
	  	
	  	Run runs = new Run();
	  	
	  	while(true) {
	  		runs.m = scanner.nextInt();
	  		runs.e = scanner.nextInt();
	  		runs.r = scanner.nextInt();
		  	
		  	if( runs.m == -1 && runs.e == -1 && runs.r == -1 )
		  		break;
		  	
	  		sum = runs.m + runs.e;
	  		
	  		
		  	if(sum >= 80)
		  		gra = "A";
		  	else if( sum >= 65 )
		  		gra = "B";
		  	else if( sum >= 50)
		  		gra = "C";
		  	else if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F";
		  		
		  	if( runs.m == -1 || runs.e == -1 )
		  		gra = "F";
		  	
		  	switch(gra){
		  	case "A":
		  		System.out.println("A");
		  		break;
		  	case "B":
		  		System.out.println("B");
		  		break;
		  	case "C":
		  		System.out.println("C");
		  		break;
		  	case "D":
		  		System.out.println("D");
		  		break;
		  	case "F":
		  		System.out.println("F");
		  	}
		  	
  		}
        scanner.close();
  } main {
	  	Scanner scanner = new Scanner(System.in);
	  	int sum;
	  	String gra;
	  	
	  	Run runs = new Run();
	  	
	  	while(true) {
	  		runs.m = scanner.nextInt();
	  		runs.e = scanner.nextInt();
	  		runs.r = scanner.nextInt();
		  	
		  	if( runs.m == -1 && runs.e == -1 && runs.r == -1 )
		  		break;
		  	
	  		sum = runs.m + runs.e;
	  		
	  		
		  	if(sum >= 80)
		  		gra = "A";
		  	else if( sum >= 65 )
		  		gra = "B";
		  	else if( sum >= 50)
		  		gra = "C";
		  	else if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F";
		  		
		  	if( runs.m == -1 || runs.e == -1 )
		  		gra = "F";
		  	
		  	switch(gra){
		  	case "A":
		  		System.out.println("A");
		  		break;
		  	case "B":
		  		System.out.println("B");
		  		break;
		  	case "C":
		  		System.out.println("C");
		  		break;
		  	case "D":
		  		System.out.println("D");
		  		break;
		  	case "F":
		  		System.out.println("F");
		  	}
		  	
  		}
        scanner.close();
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int sum; sum String gra; gra Run runs = new Run(); runs new Run() while(true) {
	  		runs.m = scanner.nextInt();
	  		runs.e = scanner.nextInt();
	  		runs.r = scanner.nextInt();
		  	
		  	if( runs.m == -1 && runs.e == -1 && runs.r == -1 )
		  		break;
		  	
	  		sum = runs.m + runs.e;
	  		
	  		
		  	if(sum >= 80)
		  		gra = "A";
		  	else if( sum >= 65 )
		  		gra = "B";
		  	else if( sum >= 50)
		  		gra = "C";
		  	else if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F";
		  		
		  	if( runs.m == -1 || runs.e == -1 )
		  		gra = "F";
		  	
		  	switch(gra){
		  	case "A":
		  		System.out.println("A");
		  		break;
		  	case "B":
		  		System.out.println("B");
		  		break;
		  	case "C":
		  		System.out.println("C");
		  		break;
		  	case "D":
		  		System.out.println("D");
		  		break;
		  	case "F":
		  		System.out.println("F");
		  	}
		  	
  		} true {
	  		runs.m = scanner.nextInt();
	  		runs.e = scanner.nextInt();
	  		runs.r = scanner.nextInt();
		  	
		  	if( runs.m == -1 && runs.e == -1 && runs.r == -1 )
		  		break;
		  	
	  		sum = runs.m + runs.e;
	  		
	  		
		  	if(sum >= 80)
		  		gra = "A";
		  	else if( sum >= 65 )
		  		gra = "B";
		  	else if( sum >= 50)
		  		gra = "C";
		  	else if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F";
		  		
		  	if( runs.m == -1 || runs.e == -1 )
		  		gra = "F";
		  	
		  	switch(gra){
		  	case "A":
		  		System.out.println("A");
		  		break;
		  	case "B":
		  		System.out.println("B");
		  		break;
		  	case "C":
		  		System.out.println("C");
		  		break;
		  	case "D":
		  		System.out.println("D");
		  		break;
		  	case "F":
		  		System.out.println("F");
		  	}
		  	
  		} runs.m = scanner.nextInt() runs.m runs runs.m scanner.nextInt() scanner.nextInt scanner runs.e = scanner.nextInt() runs.e runs runs.e scanner.nextInt() scanner.nextInt scanner runs.r = scanner.nextInt() runs.r runs runs.r scanner.nextInt() scanner.nextInt scanner if( runs.m == -1 && runs.e == -1 && runs.r == -1 )
		  		break; runs.m == -1 && runs.e == -1 && runs.r == -1 runs.m == -1 && runs.e == -1 && runs.r == -1 runs.m == -1 runs.m runs runs.m -1 1 runs.e == -1 runs.e runs runs.e -1 1 runs.r == -1 runs.r runs runs.r -1 1 break; sum = runs.m + runs.e sum runs.m + runs.e runs.m runs runs.m runs.e runs runs.e if(sum >= 80)
		  		gra = "A";
		  	else if( sum >= 65 )
		  		gra = "B";
		  	else if( sum >= 50)
		  		gra = "C";
		  	else if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F"; sum >= 80 sum 80 gra = "A" gra "A" if( sum >= 65 )
		  		gra = "B";
		  	else if( sum >= 50)
		  		gra = "C";
		  	else if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F"; sum >= 65 sum 65 gra = "B" gra "B" if( sum >= 50)
		  		gra = "C";
		  	else if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F"; sum >= 50 sum 50 gra = "C" gra "C" if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F"; sum >= 30 && runs.r >= 50 sum >= 30 sum 30 runs.r >= 50 runs.r runs runs.r 50 gra = "C" gra "C" if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F"; sum >= 30 sum 30 gra = "D" gra "D" gra = "F" gra "F" if( runs.m == -1 || runs.e == -1 )
		  		gra = "F"; runs.m == -1 || runs.e == -1 runs.m == -1 runs.m runs runs.m -1 1 runs.e == -1 runs.e runs runs.e -1 1 gra = "F" gra "F" switch(gra){
		  	case "A":
		  		System.out.println("A");
		  		break;
		  	case "B":
		  		System.out.println("B");
		  		break;
		  	case "C":
		  		System.out.println("C");
		  		break;
		  	case "D":
		  		System.out.println("D");
		  		break;
		  	case "F":
		  		System.out.println("F");
		  	} gra case "A": "A" case "A": System.out.println("A") System.out.println System.out System System.out "A" break; case "B": "B" case "B": System.out.println("B") System.out.println System.out System System.out "B" break; case "C": "C" case "C": System.out.println("C") System.out.println System.out System System.out "C" break; case "D": "D" case "D": System.out.println("D") System.out.println System.out System System.out "D" break; case "F": "F" case "F": System.out.println("F") System.out.println System.out System System.out "F" scanner.close() scanner.close scanner String args[] args
import java.util.Scanner;

class Run{
	public int m = 50;
	public int e = 50;
	public int r = 100;
}
	

class Main {
  public static void main(String args[]) {
	  	Scanner scanner = new Scanner(System.in);
	  	int sum;
	  	String gra;
	  	
	  	Run runs = new Run();
	  	
	  	while(true) {
	  		runs.m = scanner.nextInt();
	  		runs.e = scanner.nextInt();
	  		runs.r = scanner.nextInt();
		  	
		  	if( runs.m == -1 && runs.e == -1 && runs.r == -1 )
		  		break;
		  	
	  		sum = runs.m + runs.e;
	  		
	  		
		  	if(sum >= 80)
		  		gra = "A";
		  	else if( sum >= 65 )
		  		gra = "B";
		  	else if( sum >= 50)
		  		gra = "C";
		  	else if( sum >= 30 && runs.r >= 50 )
		  		gra = "C";
		  	else if( sum >= 30)
		  		gra = "D";
		  	else
		  		gra = "F";
		  		
		  	if( runs.m == -1 || runs.e == -1 )
		  		gra = "F";
		  	
		  	switch(gra){
		  	case "A":
		  		System.out.println("A");
		  		break;
		  	case "B":
		  		System.out.println("B");
		  		break;
		  	case "C":
		  		System.out.println("C");
		  		break;
		  	case "D":
		  		System.out.println("D");
		  		break;
		  	case "F":
		  		System.out.println("F");
		  	}
		  	
  		}
        scanner.close();
  }
}
