import java.util.*;


public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> rc = new ArrayList<Integer>();
		int r,c,i,d,ck;
		
		for(c=0;;c++){
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck>0){
				r=0;
			}
			rc.add(r);
		}
		sc.close();
		for(i=0;i<=c;i++){
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		}
	}
} import java.util.*; util.* java public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> rc = new ArrayList<Integer>();
		int r,c,i,d,ck;
		
		for(c=0;;c++){
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck>0){
				r=0;
			}
			rc.add(r);
		}
		sc.close();
		for(i=0;i<=c;i++){
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		}
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> rc = new ArrayList<Integer>();
		int r,c,i,d,ck;
		
		for(c=0;;c++){
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck>0){
				r=0;
			}
			rc.add(r);
		}
		sc.close();
		for(i=0;i<=c;i++){
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		}
	} main {

		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> rc = new ArrayList<Integer>();
		int r,c,i,d,ck;
		
		for(c=0;;c++){
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck>0){
				r=0;
			}
			rc.add(r);
		}
		sc.close();
		for(i=0;i<=c;i++){
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<Integer> rc = new ArrayList<Integer>(); rc new ArrayList<Integer>() int r r c c i i d d ck; ck for(c=0;;c++){
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck>0){
				r=0;
			}
			rc.add(r);
		} c=0; c=0 c 0 c++ c++ c {
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck>0){
				r=0;
			}
			rc.add(r);
		} {
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck>0){
				r=0;
			}
			rc.add(r);
		} r=0 r 0 ck=0 ck 0 for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			} i=0; i=0 i 0 i<3 i 3 i++ i++ i {
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			} {
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			} d = sc.nextInt() d sc.nextInt() sc.nextInt sc if(i<2&&d == -1){
					ck++;
				} i<2&&d == -1 i<2 i 2 d == -1 d -1 1 {
					ck++;
				} ck++ ck if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				} i == 2 && r<50 && d >49 i == 2 && r<50 && d >49 i == 2 i 2 r<50 r 50 d >49 d 49 {
					r = 50;
					break;
				} r = 50 r 50 break; if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				} i == 2 && r<50 && d < 50 i == 2 && r<50 && d < 50 i == 2 i 2 r<50 r 50 d < 50 d 50 {
					d = -1;
				} d = -1 d -1 1 if(i == 2 && r>50){
					d = -1;
				} i == 2 && r>50 i == 2 i 2 r>50 r 50 {
					d = -1;
				} d = -1 d -1 1 r += d r d if(i == 2 && d == -1 && r != -3){
					r++;
				} i == 2 && d == -1 && r != -3 i == 2 && d == -1 && r != -3 i == 2 i 2 d == -1 d -1 1 r != -3 r -3 3 {
					r++;
				} r++ r if(r == -3){
				c--;
				break;
			} r == -3 r -3 3 {
				c--;
				break;
			} c-- c break; if(ck>0){
				r=0;
			} ck>0 ck 0 {
				r=0;
			} r=0 r 0 rc.add(r) rc.add rc r sc.close() sc.close sc for(i=0;i<=c;i++){
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		} i=0; i=0 i 0 i<=c i c i++ i++ i {
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		} {
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		} if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			} rc.get(i)>79 rc.get(i) rc.get rc i 79 {
				System.out.println("A");
			} System.out.println("A") System.out.println System.out System System.out "A" if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			} rc.get(i)>64 rc.get(i) rc.get rc i 64 {
				System.out.println("B");
			} System.out.println("B") System.out.println System.out System System.out "B" if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			} rc.get(i)>49 rc.get(i) rc.get rc i 49 {
				System.out.println("C");
			} System.out.println("C") System.out.println System.out System System.out "C" if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			} rc.get(i)>29 rc.get(i) rc.get rc i 29 {
				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" String[] args args public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> rc = new ArrayList<Integer>();
		int r,c,i,d,ck;
		
		for(c=0;;c++){
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck>0){
				r=0;
			}
			rc.add(r);
		}
		sc.close();
		for(i=0;i<=c;i++){
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		}
	}
} public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> rc = new ArrayList<Integer>();
		int r,c,i,d,ck;
		
		for(c=0;;c++){
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck>0){
				r=0;
			}
			rc.add(r);
		}
		sc.close();
		for(i=0;i<=c;i++){
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		}
	}
} Main
import java.util.*;


public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> rc = new ArrayList<Integer>();
		int r,c,i,d,ck;
		
		for(c=0;;c++){
			r=0;
			ck=0;
			for(i=0;i<3;i++){
				d = sc.nextInt();
				if(i<2&&d == -1){
					ck++;
				}
				if(i == 2 && r<50 && d >49){
					r = 50;
					break;
				}
				else if(i == 2 && r<50 && d < 50){
					d = -1;
				}
				else if(i == 2 && r>50){
					d = -1;
				}
				r += d;
				if(i == 2 && d == -1 && r != -3){
					r++;
				}
			}
			if(r == -3){
				c--;
				break;
			}
			if(ck>0){
				r=0;
			}
			rc.add(r);
		}
		sc.close();
		for(i=0;i<=c;i++){
			if(rc.get(i)>79){
				System.out.println("A");
			}
			else if(rc.get(i)>64){
				System.out.println("B");
			}
			else if(rc.get(i)>49){
				System.out.println("C");
			}
			else if(rc.get(i)>29){
				System.out.println("D");
			}
			else{
				System.out.println("F");
			}
		}
	}
}
