import java.awt.*;
import java.awt.geom.*;
import java.io.*;

import java.util.*;
class Main {

	static char[] xx = new char[] {'S','H','C','D'};
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) {
				System.out.println("F");
				continue;
			}
			if(m + f >= 80) {
				System.out.println("A");
				continue;
			}
			else if(m + f >= 65) {
				System.out.println("B");
			}
			else if(m + f >= 50) {
				System.out.println("C");
			}
			else if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			}
			
		}

	}
} import java.awt.*; awt.* java import java.awt.geom.*; geom.* java.awt import java.io.*; io.* java import java.util.*; util.* java class Main {

	static char[] xx = new char[] {'S','H','C','D'};
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) {
				System.out.println("F");
				continue;
			}
			if(m + f >= 80) {
				System.out.println("A");
				continue;
			}
			else if(m + f >= 65) {
				System.out.println("B");
			}
			else if(m + f >= 50) {
				System.out.println("C");
			}
			else if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			}
			
		}

	}
} Main static char[] xx = new char[] {'S','H','C','D'}; xx new char[] {'S','H','C','D'} public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) {
				System.out.println("F");
				continue;
			}
			if(m + f >= 80) {
				System.out.println("A");
				continue;
			}
			else if(m + f >= 65) {
				System.out.println("B");
			}
			else if(m + f >= 50) {
				System.out.println("C");
			}
			else if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			}
			
		}

	} main {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) {
				System.out.println("F");
				continue;
			}
			if(m + f >= 80) {
				System.out.println("A");
				continue;
			}
			else if(m + f >= 65) {
				System.out.println("B");
			}
			else if(m + f >= 50) {
				System.out.println("C");
			}
			else if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			}
			
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) {
				System.out.println("F");
				continue;
			}
			if(m + f >= 80) {
				System.out.println("A");
				continue;
			}
			else if(m + f >= 65) {
				System.out.println("B");
			}
			else if(m + f >= 50) {
				System.out.println("C");
			}
			else if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			}
			
		} true {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) {
				System.out.println("F");
				continue;
			}
			if(m + f >= 80) {
				System.out.println("A");
				continue;
			}
			else if(m + f >= 65) {
				System.out.println("B");
			}
			else if(m + f >= 50) {
				System.out.println("C");
			}
			else if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			}
			
		} int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc if(m == -1 && f == -1 && r == -1) break; 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 break; if(m == -1 || f == -1) {
				System.out.println("F");
				continue;
			} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
				System.out.println("F");
				continue;
			} System.out.println("F") System.out.println System.out System System.out "F" continue; if(m + f >= 80) {
				System.out.println("A");
				continue;
			}
			else if(m + f >= 65) {
				System.out.println("B");
			}
			else if(m + f >= 50) {
				System.out.println("C");
			}
			else if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			} m + f >= 80 m + f m f 80 {
				System.out.println("A");
				continue;
			} System.out.println("A") System.out.println System.out System System.out "A" continue; if(m + f >= 65) {
				System.out.println("B");
			}
			else if(m + f >= 50) {
				System.out.println("C");
			}
			else if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			} m + f >= 65 m + f m f 65 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if(m + f >= 50) {
				System.out.println("C");
			}
			else if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			} m + f >= 50 m + f m f 50 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			} m +f < 30 m +f m f 30 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" {
				System.out.println((r >= 50)?"C":"D");
			} System.out.println((r >= 50)?"C":"D") System.out.println System.out System System.out (r >= 50)?"C":"D" (r >= 50) r 50 "C" "D" String[] args args
import java.awt.*;
import java.awt.geom.*;
import java.io.*;

import java.util.*;
class Main {

	static char[] xx = new char[] {'S','H','C','D'};
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true) {
			int m = sc.nextInt();
			int f = sc.nextInt();
			int r = sc.nextInt();
			if(m == -1 && f == -1 && r == -1) break;
			
			if(m == -1 || f == -1) {
				System.out.println("F");
				continue;
			}
			if(m + f >= 80) {
				System.out.println("A");
				continue;
			}
			else if(m + f >= 65) {
				System.out.println("B");
			}
			else if(m + f >= 50) {
				System.out.println("C");
			}
			else if(m +f < 30) {
				System.out.println("F");
			}
			else {
				System.out.println((r >= 50)?"C":"D");
			}
			
		}

	}
}