import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		List<Integer> m = new ArrayList<Integer>();
		List<Integer> f = new ArrayList<Integer>();
		List<Integer> r = new ArrayList<Integer>();

		 for(int i=0;;i++){
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 }

		 for(int i=0;;i++){
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 }
	}

	static void judgeGrade(int mid,int last,int re){
		if(mid==-1 || last==-1){
			System.out.println("F");
		}else if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		}

	}

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		List<Integer> m = new ArrayList<Integer>();
		List<Integer> f = new ArrayList<Integer>();
		List<Integer> r = new ArrayList<Integer>();

		 for(int i=0;;i++){
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 }

		 for(int i=0;;i++){
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 }
	}

	static void judgeGrade(int mid,int last,int re){
		if(mid==-1 || last==-1){
			System.out.println("F");
		}else if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		}

	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		List<Integer> m = new ArrayList<Integer>();
		List<Integer> f = new ArrayList<Integer>();
		List<Integer> r = new ArrayList<Integer>();

		 for(int i=0;;i++){
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 }

		 for(int i=0;;i++){
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 }
	} main {
		Scanner scan = new Scanner(System.in);
		List<Integer> m = new ArrayList<Integer>();
		List<Integer> f = new ArrayList<Integer>();
		List<Integer> r = new ArrayList<Integer>();

		 for(int i=0;;i++){
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 }

		 for(int i=0;;i++){
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 }
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) List<Integer> m = new ArrayList<Integer>(); m new ArrayList<Integer>() List<Integer> f = new ArrayList<Integer>(); f new ArrayList<Integer>() List<Integer> r = new ArrayList<Integer>(); r new ArrayList<Integer>() for(int i=0;;i++){
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 } int i=0; int i=0; i 0 i++ i++ i {
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 } {
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 } m.add(i, scan.nextInt()) m.add m i scan.nextInt() scan.nextInt scan f.add(i, scan.nextInt()) f.add f i scan.nextInt() scan.nextInt scan r.add(i, scan.nextInt()) r.add r i scan.nextInt() scan.nextInt scan if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break; m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1 m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1 m.get(i)==-1 m.get(i) m.get m i -1 1 f.get(i)==-1 f.get(i) f.get f i -1 1 r.get(i)==-1 r.get(i) r.get r i -1 1 break; for(int i=0;;i++){
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 } int i=0; int i=0; i 0 i++ i++ i {
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 } {
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 } if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break; m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1 m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1 m.get(i)==-1 m.get(i) m.get m i -1 1 f.get(i)==-1 f.get(i) f.get f i -1 1 r.get(i)==-1 r.get(i) r.get r i -1 1 break; judgeGrade(m.get(i),f.get(i),r.get(i)) judgeGrade m.get(i) m.get m i f.get(i) f.get f i r.get(i) r.get r i String[] args args static void judgeGrade(int mid,int last,int re){
		if(mid==-1 || last==-1){
			System.out.println("F");
		}else if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		}

	} judgeGrade {
		if(mid==-1 || last==-1){
			System.out.println("F");
		}else if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		}

	} if(mid==-1 || last==-1){
			System.out.println("F");
		}else if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		} mid==-1 || last==-1 mid==-1 mid -1 1 last==-1 last -1 1 {
			System.out.println("F");
		} System.out.println("F") System.out.println System.out System System.out "F" if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		} mid+last >= 80 mid+last mid last 80 {
			System.out.println("A");
		} System.out.println("A") System.out.println System.out System System.out "A" if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		} mid+last >= 65 mid+last mid last 65 {
			System.out.println("B");
		} System.out.println("B") System.out.println System.out System System.out "B" if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		} mid+last >= 50 || re >= 50 mid+last >= 50 mid+last mid last 50 re >= 50 re 50 {
			System.out.println("C");
		} System.out.println("C") System.out.println System.out System System.out "C" if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		} mid+last >= 30 mid+last mid last 30 {
			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" int mid mid int last last int re re public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		List<Integer> m = new ArrayList<Integer>();
		List<Integer> f = new ArrayList<Integer>();
		List<Integer> r = new ArrayList<Integer>();

		 for(int i=0;;i++){
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 }

		 for(int i=0;;i++){
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 }
	}

	static void judgeGrade(int mid,int last,int re){
		if(mid==-1 || last==-1){
			System.out.println("F");
		}else if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		}

	}

} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		List<Integer> m = new ArrayList<Integer>();
		List<Integer> f = new ArrayList<Integer>();
		List<Integer> r = new ArrayList<Integer>();

		 for(int i=0;;i++){
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 }

		 for(int i=0;;i++){
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 }
	}

	static void judgeGrade(int mid,int last,int re){
		if(mid==-1 || last==-1){
			System.out.println("F");
		}else if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		}

	}

} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		List<Integer> m = new ArrayList<Integer>();
		List<Integer> f = new ArrayList<Integer>();
		List<Integer> r = new ArrayList<Integer>();

		 for(int i=0;;i++){
			 m.add(i, scan.nextInt());
			 f.add(i, scan.nextInt());
			 r.add(i, scan.nextInt());
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
		 }

		 for(int i=0;;i++){
			 if(m.get(i)==-1 && f.get(i)==-1 && r.get(i)==-1) break;
			judgeGrade(m.get(i),f.get(i),r.get(i));
		 }
	}

	static void judgeGrade(int mid,int last,int re){
		if(mid==-1 || last==-1){
			System.out.println("F");
		}else if(mid+last >= 80){
			System.out.println("A");
		}else if(mid+last >= 65){
			System.out.println("B");
		}else if(mid+last >= 50 || re >= 50) {
			System.out.println("C");
		}else if(mid+last >= 30){
			System.out.println("D");
		}else{
			System.out.println("F");
		}

	}

}