import java.util.Scanner;

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