import java.util.Scanner;

public class Main{
	  public static void judge(int m,int f,int r) {
		  if(m==-1 && f==-1 && r==-1) {
			  System.exit(0);
		  }
		  if(m==-1 || f == -1) {
			  System.out.print("F");
		  }else {
	
		  if(m+f>=80) {
		 
		  System.out.print("A");
	      }
		  else if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  }
		  
		  }
	}
		  
	  public static void main(String[] args) {
		  Scanner x = new Scanner(System.in);
		  for(;;) {
		  int data [] = new int[3];
		  for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			}		 
		 judge(data[0],data[1],data[2]);
		 System.out.println();
		  }
	  }
	} import java.util.Scanner; Scanner java.util public class Main{
	  public static void judge(int m,int f,int r) {
		  if(m==-1 && f==-1 && r==-1) {
			  System.exit(0);
		  }
		  if(m==-1 || f == -1) {
			  System.out.print("F");
		  }else {
	
		  if(m+f>=80) {
		 
		  System.out.print("A");
	      }
		  else if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  }
		  
		  }
	}
		  
	  public static void main(String[] args) {
		  Scanner x = new Scanner(System.in);
		  for(;;) {
		  int data [] = new int[3];
		  for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			}		 
		 judge(data[0],data[1],data[2]);
		 System.out.println();
		  }
	  }
	} Main public static void judge(int m,int f,int r) {
		  if(m==-1 && f==-1 && r==-1) {
			  System.exit(0);
		  }
		  if(m==-1 || f == -1) {
			  System.out.print("F");
		  }else {
	
		  if(m+f>=80) {
		 
		  System.out.print("A");
	      }
		  else if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  }
		  
		  }
	} judge {
		  if(m==-1 && f==-1 && r==-1) {
			  System.exit(0);
		  }
		  if(m==-1 || f == -1) {
			  System.out.print("F");
		  }else {
	
		  if(m+f>=80) {
		 
		  System.out.print("A");
	      }
		  else if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  }
		  
		  }
	} if(m==-1 && f==-1 && r==-1) {
			  System.exit(0);
		  } 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.exit(0);
		  } System.exit(0) System.exit System 0 if(m==-1 || f == -1) {
			  System.out.print("F");
		  }else {
	
		  if(m+f>=80) {
		 
		  System.out.print("A");
	      }
		  else if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  }
		  
		  } m==-1 || f == -1 m==-1 m -1 1 f == -1 f -1 1 {
			  System.out.print("F");
		  } System.out.print("F") System.out.print System.out System System.out "F" {
	
		  if(m+f>=80) {
		 
		  System.out.print("A");
	      }
		  else if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  }
		  
		  } if(m+f>=80) {
		 
		  System.out.print("A");
	      }
		  else if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  } m+f>=80 m+f m f 80 {
		 
		  System.out.print("A");
	      } System.out.print("A") System.out.print System.out System System.out "A" if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  } m+f<80 && m+f>=65 m+f<80 m+f m f 80 m+f>=65 m+f m f 65 {
			
		  System.out.print("B");
	      } System.out.print("B") System.out.print System.out System System.out "B" if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  } m+f<65 && m+f>=50 m+f<65 m+f m f 65 m+f>=50 m+f m f 50 {
			 
		  System.out.print("C");		 
	      } System.out.print("C") System.out.print System.out System System.out "C" if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  } m+f<50 && m+f>=30 && r<50 m+f<50 && m+f>=30 && r<50 m+f<50 m+f m f 50 m+f>=30 m+f m f 30 r<50 r 50 {
			
		  System.out.print("D");
		  } System.out.print("D") System.out.print System.out System System.out "D" if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  } r>=50 r 50 {
			 
		  System.out.print("C");
		  } System.out.print("C") System.out.print System.out System System.out "C" if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  } m+f<30 || r!=-1 m+f<30 m+f m f 30 r!=-1 r -1 1 {
			  
		  System.out.print("F");
		  } System.out.print("F") System.out.print System.out System System.out "F" int m m int f f int r r public static void main(String[] args) {
		  Scanner x = new Scanner(System.in);
		  for(;;) {
		  int data [] = new int[3];
		  for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			}		 
		 judge(data[0],data[1],data[2]);
		 System.out.println();
		  }
	  } main {
		  Scanner x = new Scanner(System.in);
		  for(;;) {
		  int data [] = new int[3];
		  for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			}		 
		 judge(data[0],data[1],data[2]);
		 System.out.println();
		  }
	  } Scanner x = new Scanner(System.in); x new Scanner(System.in) for(;;) {
		  int data [] = new int[3];
		  for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			}		 
		 judge(data[0],data[1],data[2]);
		 System.out.println();
		  } ; {
		  int data [] = new int[3];
		  for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			}		 
		 judge(data[0],data[1],data[2]);
		 System.out.println();
		  } {
		  int data [] = new int[3];
		  for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			}		 
		 judge(data[0],data[1],data[2]);
		 System.out.println();
		  } int data [] = new int[3]; data new int[3] 3 for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			} int i = 0; int i = 0; i 0 i<3 i 3 i++ i++ i {
				data[i]=x.nextInt();
			} {
				data[i]=x.nextInt();
			} data[i]=x.nextInt() data[i] data i x.nextInt() x.nextInt x judge(data[0],data[1],data[2]) judge data[0] data 0 data[1] data 1 data[2] data 2 System.out.println() System.out.println System.out System System.out String[] args args public class Main{
	  public static void judge(int m,int f,int r) {
		  if(m==-1 && f==-1 && r==-1) {
			  System.exit(0);
		  }
		  if(m==-1 || f == -1) {
			  System.out.print("F");
		  }else {
	
		  if(m+f>=80) {
		 
		  System.out.print("A");
	      }
		  else if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  }
		  
		  }
	}
		  
	  public static void main(String[] args) {
		  Scanner x = new Scanner(System.in);
		  for(;;) {
		  int data [] = new int[3];
		  for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			}		 
		 judge(data[0],data[1],data[2]);
		 System.out.println();
		  }
	  }
	} public class Main{
	  public static void judge(int m,int f,int r) {
		  if(m==-1 && f==-1 && r==-1) {
			  System.exit(0);
		  }
		  if(m==-1 || f == -1) {
			  System.out.print("F");
		  }else {
	
		  if(m+f>=80) {
		 
		  System.out.print("A");
	      }
		  else if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  }
		  
		  }
	}
		  
	  public static void main(String[] args) {
		  Scanner x = new Scanner(System.in);
		  for(;;) {
		  int data [] = new int[3];
		  for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			}		 
		 judge(data[0],data[1],data[2]);
		 System.out.println();
		  }
	  }
	} Main
import java.util.Scanner;

public class Main{
	  public static void judge(int m,int f,int r) {
		  if(m==-1 && f==-1 && r==-1) {
			  System.exit(0);
		  }
		  if(m==-1 || f == -1) {
			  System.out.print("F");
		  }else {
	
		  if(m+f>=80) {
		 
		  System.out.print("A");
	      }
		  else if(m+f<80 && m+f>=65) {
			
		  System.out.print("B");
	      }
		  else  if(m+f<65 && m+f>=50) {
			 
		  System.out.print("C");		 
	      }
		  else if(m+f<50 && m+f>=30 && r<50) {
			
		  System.out.print("D");
		  }else if(r>=50) {
			 
		  System.out.print("C");
		  }
		  else  if(m+f<30 || r!=-1) {
			  
		  System.out.print("F");
		  }
		  
		  }
	}
		  
	  public static void main(String[] args) {
		  Scanner x = new Scanner(System.in);
		  for(;;) {
		  int data [] = new int[3];
		  for(int i = 0;i<3;i++) {
				data[i]=x.nextInt();
			}		 
		 judge(data[0],data[1],data[2]);
		 System.out.println();
		  }
	  }
	}
