import java.io.IOException;
import java.util.Scanner;

public class Main {
    public static void main (String args[]) throws IOException {
    	Scanner sc = new Scanner(System.in);
    	StringBuffer buf =new StringBuffer();
    	int m,f,r,u;
    	while(true){
    	    m = sc.nextInt();
    	    f = sc.nextInt();
    	    r = sc.nextInt();
    	    u = m+f;
    	    if(m==-1&&f==-1&&r==-1){
    	    	System.out.print(buf);
    	        break;
    	    }



    	    if(m==-1||f==-1){
    	            buf.append("F").append("\n");
    	    }else if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    }
    }
}
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main (String args[]) throws IOException {
    	Scanner sc = new Scanner(System.in);
    	StringBuffer buf =new StringBuffer();
    	int m,f,r,u;
    	while(true){
    	    m = sc.nextInt();
    	    f = sc.nextInt();
    	    r = sc.nextInt();
    	    u = m+f;
    	    if(m==-1&&f==-1&&r==-1){
    	    	System.out.print(buf);
    	        break;
    	    }



    	    if(m==-1||f==-1){
    	            buf.append("F").append("\n");
    	    }else if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    }
    }
}
} Main public static void main (String args[]) throws IOException {
    	Scanner sc = new Scanner(System.in);
    	StringBuffer buf =new StringBuffer();
    	int m,f,r,u;
    	while(true){
    	    m = sc.nextInt();
    	    f = sc.nextInt();
    	    r = sc.nextInt();
    	    u = m+f;
    	    if(m==-1&&f==-1&&r==-1){
    	    	System.out.print(buf);
    	        break;
    	    }



    	    if(m==-1||f==-1){
    	            buf.append("F").append("\n");
    	    }else if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    }
    }
} main {
    	Scanner sc = new Scanner(System.in);
    	StringBuffer buf =new StringBuffer();
    	int m,f,r,u;
    	while(true){
    	    m = sc.nextInt();
    	    f = sc.nextInt();
    	    r = sc.nextInt();
    	    u = m+f;
    	    if(m==-1&&f==-1&&r==-1){
    	    	System.out.print(buf);
    	        break;
    	    }



    	    if(m==-1||f==-1){
    	            buf.append("F").append("\n");
    	    }else if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    }
    }
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuffer buf =new StringBuffer(); buf new StringBuffer() int m m f f r r u; u while(true){
    	    m = sc.nextInt();
    	    f = sc.nextInt();
    	    r = sc.nextInt();
    	    u = m+f;
    	    if(m==-1&&f==-1&&r==-1){
    	    	System.out.print(buf);
    	        break;
    	    }



    	    if(m==-1||f==-1){
    	            buf.append("F").append("\n");
    	    }else if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    }
    } true {
    	    m = sc.nextInt();
    	    f = sc.nextInt();
    	    r = sc.nextInt();
    	    u = m+f;
    	    if(m==-1&&f==-1&&r==-1){
    	    	System.out.print(buf);
    	        break;
    	    }



    	    if(m==-1||f==-1){
    	            buf.append("F").append("\n");
    	    }else if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    }
    } m = sc.nextInt() m sc.nextInt() sc.nextInt sc f = sc.nextInt() f sc.nextInt() sc.nextInt sc r = sc.nextInt() r sc.nextInt() sc.nextInt sc u = m+f u m+f m f if(m==-1&&f==-1&&r==-1){
    	    	System.out.print(buf);
    	        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 {
    	    	System.out.print(buf);
    	        break;
    	    } System.out.print(buf) System.out.print System.out System System.out buf break; if(m==-1||f==-1){
    	            buf.append("F").append("\n");
    	    }else if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    } m==-1||f==-1 m==-1 m -1 1 f==-1 f -1 1 {
    	            buf.append("F").append("\n");
    	    } buf.append("F").append("\n") buf.append("F").append buf.append("F") buf.append buf "F" "\n" if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    } 80<=u 80 u {
    	    	buf.append("A").append("\n");
    	    } buf.append("A").append("\n") buf.append("A").append buf.append("A") buf.append buf "A" "\n" if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    } 65<=u&&u<80 65<=u 65 u u<80 u 80 {
    	    	buf.append("B").append("\n");
    	    } buf.append("B").append("\n") buf.append("B").append buf.append("B") buf.append buf "B" "\n" if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    } 50<=u&&u<65 50<=u 50 u u<65 u 65 {
    	    	buf.append("C").append("\n");
    	    } buf.append("C").append("\n") buf.append("C").append buf.append("C") buf.append buf "C" "\n" if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    } 30<=u&&u<50 30<=u 30 u u<50 u 50 {
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    } if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         } 50<=r 50 r {
    	        	 buf.append("C").append("\n");
    	         } buf.append("C").append("\n") buf.append("C").append buf.append("C") buf.append buf "C" "\n" {
    	        	 buf.append("D").append("\n");
    	         } buf.append("D").append("\n") buf.append("D").append buf.append("D") buf.append buf "D" "\n" {
    	    	buf.append("F").append("\n");
    	    } buf.append("F").append("\n") buf.append("F").append buf.append("F") buf.append buf "F" "\n" String args[] args public class Main {
    public static void main (String args[]) throws IOException {
    	Scanner sc = new Scanner(System.in);
    	StringBuffer buf =new StringBuffer();
    	int m,f,r,u;
    	while(true){
    	    m = sc.nextInt();
    	    f = sc.nextInt();
    	    r = sc.nextInt();
    	    u = m+f;
    	    if(m==-1&&f==-1&&r==-1){
    	    	System.out.print(buf);
    	        break;
    	    }



    	    if(m==-1||f==-1){
    	            buf.append("F").append("\n");
    	    }else if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    }
    }
}
} public class Main {
    public static void main (String args[]) throws IOException {
    	Scanner sc = new Scanner(System.in);
    	StringBuffer buf =new StringBuffer();
    	int m,f,r,u;
    	while(true){
    	    m = sc.nextInt();
    	    f = sc.nextInt();
    	    r = sc.nextInt();
    	    u = m+f;
    	    if(m==-1&&f==-1&&r==-1){
    	    	System.out.print(buf);
    	        break;
    	    }



    	    if(m==-1||f==-1){
    	            buf.append("F").append("\n");
    	    }else if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    }
    }
}
} Main
import java.io.IOException;
import java.util.Scanner;

public class Main {
    public static void main (String args[]) throws IOException {
    	Scanner sc = new Scanner(System.in);
    	StringBuffer buf =new StringBuffer();
    	int m,f,r,u;
    	while(true){
    	    m = sc.nextInt();
    	    f = sc.nextInt();
    	    r = sc.nextInt();
    	    u = m+f;
    	    if(m==-1&&f==-1&&r==-1){
    	    	System.out.print(buf);
    	        break;
    	    }



    	    if(m==-1||f==-1){
    	            buf.append("F").append("\n");
    	    }else if(80<=u){
    	    	buf.append("A").append("\n");
    	    }else if(65<=u&&u<80){
    	    	buf.append("B").append("\n");
    	    }else if(50<=u&&u<65){
    	    	buf.append("C").append("\n");
    	    }else if(30<=u&&u<50){
    	         if(50<=r){
    	        	 buf.append("C").append("\n");
    	         }else{
    	        	 buf.append("D").append("\n");
    	         }
    	    }else{
    	    	buf.append("F").append("\n");
    	    }
    }
}
}