import java.util.*;
public class Main{
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);



while(true){
  int a = sc.nextInt();
  int b = sc.nextInt();
  int saisi = sc.nextInt();
  int c = a+b;
  if(a==-1 && b==-1 && saisi==-1){
    break;
  }
if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
}
}
//sc.close();
}
}
 import java.util.*; util.* java public class Main{
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);



while(true){
  int a = sc.nextInt();
  int b = sc.nextInt();
  int saisi = sc.nextInt();
  int c = a+b;
  if(a==-1 && b==-1 && saisi==-1){
    break;
  }
if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
}
}
//sc.close();
}
} Main public static void main(String[] args) {

Scanner sc = new Scanner(System.in);



while(true){
  int a = sc.nextInt();
  int b = sc.nextInt();
  int saisi = sc.nextInt();
  int c = a+b;
  if(a==-1 && b==-1 && saisi==-1){
    break;
  }
if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
}
}
//sc.close();
} main {

Scanner sc = new Scanner(System.in);



while(true){
  int a = sc.nextInt();
  int b = sc.nextInt();
  int saisi = sc.nextInt();
  int c = a+b;
  if(a==-1 && b==-1 && saisi==-1){
    break;
  }
if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
}
}
//sc.close();
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(true){
  int a = sc.nextInt();
  int b = sc.nextInt();
  int saisi = sc.nextInt();
  int c = a+b;
  if(a==-1 && b==-1 && saisi==-1){
    break;
  }
if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
}
} true {
  int a = sc.nextInt();
  int b = sc.nextInt();
  int saisi = sc.nextInt();
  int c = a+b;
  if(a==-1 && b==-1 && saisi==-1){
    break;
  }
if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
}
} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int saisi = sc.nextInt(); saisi sc.nextInt() sc.nextInt sc int c = a+b; c a+b a b if(a==-1 && b==-1 && saisi==-1){
    break;
  } a==-1 && b==-1 && saisi==-1 a==-1 && b==-1 && saisi==-1 a==-1 a -1 1 b==-1 b -1 1 saisi==-1 saisi -1 1 {
    break;
  } break; if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
} a==-1||b==-1 a==-1 a -1 1 b==-1 b -1 1 {
  System.out.println("F");
} System.out.println("F") System.out.println System.out System System.out "F" if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
} c >= 80 c 80 {
 System.out.println("A");
} System.out.println("A") System.out.println System.out System System.out "A" if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
} c >= 65 c 65 {
  System.out.println("B");
} System.out.println("B") System.out.println System.out System System.out "B" if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
} c >= 50 c 50 {
  System.out.println("C");
} System.out.println("C") System.out.println System.out System System.out "C" if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
} c >= 30 c 30 {
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

} if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  } saisi >= 50 saisi 50 {
    System.out.println("C");

  } System.out.println("C") System.out.println System.out System System.out "C" {
    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 public class Main{
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);



while(true){
  int a = sc.nextInt();
  int b = sc.nextInt();
  int saisi = sc.nextInt();
  int c = a+b;
  if(a==-1 && b==-1 && saisi==-1){
    break;
  }
if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
}
}
//sc.close();
}
} public class Main{
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);



while(true){
  int a = sc.nextInt();
  int b = sc.nextInt();
  int saisi = sc.nextInt();
  int c = a+b;
  if(a==-1 && b==-1 && saisi==-1){
    break;
  }
if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
}
}
//sc.close();
}
} Main
import java.util.*;
public class Main{
public static void main(String[] args) {

Scanner sc = new Scanner(System.in);



while(true){
  int a = sc.nextInt();
  int b = sc.nextInt();
  int saisi = sc.nextInt();
  int c = a+b;
  if(a==-1 && b==-1 && saisi==-1){
    break;
  }
if(a==-1||b==-1){
  System.out.println("F");
}else if(c >= 80){
 System.out.println("A");
}else if(c >= 65){
  System.out.println("B");
}else if(c >= 50){
  System.out.println("C");
}else if(c >= 30){
  if(saisi >= 50){
    System.out.println("C");

  }else{
    System.out.println("D");
  }

}else {
  System.out.println("F");
}
}
//sc.close();
}
}

