import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(true){
int m=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int score=m+f;
if(score+r==-3)break;
    if(m==-1||f==-1){
    System.out.println("F");
    }else if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");}
}
}
} import java.util.*; util.* java public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(true){
int m=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int score=m+f;
if(score+r==-3)break;
    if(m==-1||f==-1){
    System.out.println("F");
    }else if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");}
}
}
} Main public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(true){
int m=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int score=m+f;
if(score+r==-3)break;
    if(m==-1||f==-1){
    System.out.println("F");
    }else if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");}
}
} main {
Scanner sc = new Scanner(System.in);
while(true){
int m=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int score=m+f;
if(score+r==-3)break;
    if(m==-1||f==-1){
    System.out.println("F");
    }else if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");}
}
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(true){
int m=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int score=m+f;
if(score+r==-3)break;
    if(m==-1||f==-1){
    System.out.println("F");
    }else if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");}
} true {
int m=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int score=m+f;
if(score+r==-3)break;
    if(m==-1||f==-1){
    System.out.println("F");
    }else if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");}
} int m=Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int f=Integer.parseInt(sc.next()); f Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int r=Integer.parseInt(sc.next()); r Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int score=m+f; score m+f m f if(score+r==-3)break; score+r==-3 score+r score r -3 3 break; if(m==-1||f==-1){
    System.out.println("F");
    }else if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");} m==-1||f==-1 m==-1 m -1 1 f==-1 f -1 1 {
    System.out.println("F");
    } System.out.println("F") System.out.println System.out System System.out "F" if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");} score>=80 score 80 {System.out.println("A");} System.out.println("A") System.out.println System.out System System.out "A" if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");} score>=65&&score<80 score>=65 score 65 score<80 score 80 {System.out.println("B");} System.out.println("B") System.out.println System.out System System.out "B" if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");} score>=50&&score<65 score>=50 score 50 score<65 score 65 {System.out.println("C");} System.out.println("C") System.out.println System.out System System.out "C" if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");} score<30 score 30 {System.out.println("F");} System.out.println("F") System.out.println System.out System System.out "F" if(r>=50){System.out.println("C");}else{System.out.println("D");} r>=50 r 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" String[] args args public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(true){
int m=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int score=m+f;
if(score+r==-3)break;
    if(m==-1||f==-1){
    System.out.println("F");
    }else if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");}
}
}
} public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(true){
int m=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int score=m+f;
if(score+r==-3)break;
    if(m==-1||f==-1){
    System.out.println("F");
    }else if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");}
}
}
} Main
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
while(true){
int m=Integer.parseInt(sc.next());
int f=Integer.parseInt(sc.next());
int r=Integer.parseInt(sc.next());
int score=m+f;
if(score+r==-3)break;
    if(m==-1||f==-1){
    System.out.println("F");
    }else if(score>=80){System.out.println("A");}else if(score>=65&&score<80){System.out.println("B");}
    else if(score>=50&&score<65){System.out.println("C");}else if(score<30){System.out.println("F");}
    else if(r>=50){System.out.println("C");}else{System.out.println("D");}
}
}
}
