public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		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 ) sb.append("F\n");
			else if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n");

		}

		System.out.print(sb);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		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 ) sb.append("F\n");
			else if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n");

		}

		System.out.print(sb);
	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		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 ) sb.append("F\n");
			else if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n");

		}

		System.out.print(sb);
	} main {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		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 ) sb.append("F\n");
			else if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n");

		}

		System.out.print(sb);
	} java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() 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 ) sb.append("F\n");
			else if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n");

		} 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 ) sb.append("F\n");
			else if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n");

		} 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 ) sb.append("F\n");
			else if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n"); m==-1 || f==-1 m==-1 m -1 1 f==-1 f -1 1 sb.append("F\n") sb.append sb "F\n" if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n"); m+f >= 80 m+f m f 80 sb.append("A\n") sb.append sb "A\n" if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n"); m+f >= 65 m+f m f 65 sb.append("B\n") sb.append sb "B\n" if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n"); m+f >= 50 m+f m f 50 sb.append("C\n") sb.append sb "C\n" if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n"); m+f >= 30 m+f m f 30 {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n"); r>=50 r 50 sb.append("C\n") sb.append sb "C\n" sb.append("D\n") sb.append sb "D\n" sb.append("F\n") sb.append sb "F\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		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 ) sb.append("F\n");
			else if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n");

		}

		System.out.print(sb);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		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 ) sb.append("F\n");
			else if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n");

		}

		System.out.print(sb);
	}

} Main
public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		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 ) sb.append("F\n");
			else if ( m+f >= 80 ) sb.append("A\n");
			else if ( m+f >= 65 ) sb.append("B\n");
			else if ( m+f >= 50 ) sb.append("C\n");
			else if ( m+f >= 30 ) {
				if ( r>=50 ) sb.append("C\n");
				else sb.append("D\n");
			} else sb.append("F\n");

		}

		System.out.print(sb);
	}

}