import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] arr = new int[3];

		do {
			for(int i = 0; i < 3; i++) {
				arr[i] = sc.nextInt();
			}

			int m = arr[0];
			int f = arr[1];
			int r = arr[2];

			int s = m + f;

			if (m == -1 && f == -1 && r == -1) {
				break;
			} else if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			}



		}while(true);

		sc.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] arr = new int[3];

		do {
			for(int i = 0; i < 3; i++) {
				arr[i] = sc.nextInt();
			}

			int m = arr[0];
			int f = arr[1];
			int r = arr[2];

			int s = m + f;

			if (m == -1 && f == -1 && r == -1) {
				break;
			} else if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			}



		}while(true);

		sc.close();
	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] arr = new int[3];

		do {
			for(int i = 0; i < 3; i++) {
				arr[i] = sc.nextInt();
			}

			int m = arr[0];
			int f = arr[1];
			int r = arr[2];

			int s = m + f;

			if (m == -1 && f == -1 && r == -1) {
				break;
			} else if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			}



		}while(true);

		sc.close();
	} main {

		Scanner sc = new Scanner(System.in);

		int[] arr = new int[3];

		do {
			for(int i = 0; i < 3; i++) {
				arr[i] = sc.nextInt();
			}

			int m = arr[0];
			int f = arr[1];
			int r = arr[2];

			int s = m + f;

			if (m == -1 && f == -1 && r == -1) {
				break;
			} else if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			}



		}while(true);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] arr = new int[3]; arr new int[3] 3 do {
			for(int i = 0; i < 3; i++) {
				arr[i] = sc.nextInt();
			}

			int m = arr[0];
			int f = arr[1];
			int r = arr[2];

			int s = m + f;

			if (m == -1 && f == -1 && r == -1) {
				break;
			} else if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			}



		}while(true); true {
			for(int i = 0; i < 3; i++) {
				arr[i] = sc.nextInt();
			}

			int m = arr[0];
			int f = arr[1];
			int r = arr[2];

			int s = m + f;

			if (m == -1 && f == -1 && r == -1) {
				break;
			} else if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			}



		} for(int i = 0; i < 3; i++) {
				arr[i] = sc.nextInt();
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
				arr[i] = sc.nextInt();
			} {
				arr[i] = sc.nextInt();
			} arr[i] = sc.nextInt() arr[i] arr i sc.nextInt() sc.nextInt sc int m = arr[0]; m arr[0] arr 0 int f = arr[1]; f arr[1] arr 1 int r = arr[2]; r arr[2] arr 2 int s = m + f; s m + f m f if (m == -1 && f == -1 && r == -1) {
				break;
			} else if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			} 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;
			} break; if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			} 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 (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

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

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

			} else if ( s < 30 ){
				System.out.println("F");
			} s >= 65 && s < 80 s >= 65 s 65 s < 80 s 80 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			} s >= 50 && s < 65 s >= 50 s 50 s < 65 s 65 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			} s >= 30 && s < 50 s >= 30 s 30 s < 50 s 50 {

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

			} 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" if ( s < 30 ){
				System.out.println("F");
			} s < 30 s 30 {
				System.out.println("F");
			} System.out.println("F") System.out.println System.out System System.out "F" sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] arr = new int[3];

		do {
			for(int i = 0; i < 3; i++) {
				arr[i] = sc.nextInt();
			}

			int m = arr[0];
			int f = arr[1];
			int r = arr[2];

			int s = m + f;

			if (m == -1 && f == -1 && r == -1) {
				break;
			} else if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			}



		}while(true);

		sc.close();
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] arr = new int[3];

		do {
			for(int i = 0; i < 3; i++) {
				arr[i] = sc.nextInt();
			}

			int m = arr[0];
			int f = arr[1];
			int r = arr[2];

			int s = m + f;

			if (m == -1 && f == -1 && r == -1) {
				break;
			} else if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			}



		}while(true);

		sc.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int[] arr = new int[3];

		do {
			for(int i = 0; i < 3; i++) {
				arr[i] = sc.nextInt();
			}

			int m = arr[0];
			int f = arr[1];
			int r = arr[2];

			int s = m + f;

			if (m == -1 && f == -1 && r == -1) {
				break;
			} else if (m == -1 || f == -1){
				System.out.println("F");
			} else if (s >= 80){
				System.out.println("A");
			} else if (s >= 65 && s < 80 ){
				System.out.println("B");
			} else if (s >= 50 && s < 65 ){
				System.out.println("C");
			} else if (s >= 30 && s < 50 ){

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

			} else if ( s < 30 ){
				System.out.println("F");
			}



		}while(true);

		sc.close();
	}

}
