import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int[] arr = parceIntArray(br.readLine().split(" "));
			Score score = new Score(arr[0], arr[1], arr[2]);
			if(score.equals(new Score(-1, -1, -1))){
				break;
			}else{
				System.out.println(score.getGrade());
			}
		}
	}
	
	private static int[] parceIntArray(String[] strArr){
		int[] arr = new int[strArr.length];
		for(int i = 0;i < arr.length;i++){
			arr[i] = Integer.parseInt(strArr[i]);
		}
		return arr;
	}
}

class Score {
	int midterm;
	int term;
	int makeUp;

	Score(int midterm, int term, int makeUp) {
		this.midterm = midterm;
		this.term = term;
		this.makeUp = makeUp;
	}

	String getGrade() {
		int finalScore = midterm + term;
		String result;
		if (midterm == -1 || term == -1 || finalScore < 30) {
			result = "F";
		} else if (finalScore < 50) {
			if (makeUp >= 50) {
				result = "C";
			} else {
				result = "D";
			}
		}else if(finalScore < 65){
			result = "C";
		}else if(finalScore < 80){
			result = "B";
		}else{
			result = "A";
		}
		return result;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + makeUp;
		result = prime * result + midterm;
		result = prime * result + term;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Score other = (Score) obj;
		if (makeUp != other.makeUp)
			return false;
		if (midterm != other.midterm)
			return false;
		if (term != other.term)
			return false;
		return true;
	}
	
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int[] arr = parceIntArray(br.readLine().split(" "));
			Score score = new Score(arr[0], arr[1], arr[2]);
			if(score.equals(new Score(-1, -1, -1))){
				break;
			}else{
				System.out.println(score.getGrade());
			}
		}
	}
	
	private static int[] parceIntArray(String[] strArr){
		int[] arr = new int[strArr.length];
		for(int i = 0;i < arr.length;i++){
			arr[i] = Integer.parseInt(strArr[i]);
		}
		return arr;
	}
} Main public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int[] arr = parceIntArray(br.readLine().split(" "));
			Score score = new Score(arr[0], arr[1], arr[2]);
			if(score.equals(new Score(-1, -1, -1))){
				break;
			}else{
				System.out.println(score.getGrade());
			}
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int[] arr = parceIntArray(br.readLine().split(" "));
			Score score = new Score(arr[0], arr[1], arr[2]);
			if(score.equals(new Score(-1, -1, -1))){
				break;
			}else{
				System.out.println(score.getGrade());
			}
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
			int[] arr = parceIntArray(br.readLine().split(" "));
			Score score = new Score(arr[0], arr[1], arr[2]);
			if(score.equals(new Score(-1, -1, -1))){
				break;
			}else{
				System.out.println(score.getGrade());
			}
		} true {
			int[] arr = parceIntArray(br.readLine().split(" "));
			Score score = new Score(arr[0], arr[1], arr[2]);
			if(score.equals(new Score(-1, -1, -1))){
				break;
			}else{
				System.out.println(score.getGrade());
			}
		} int[] arr = parceIntArray(br.readLine().split(" ")); arr parceIntArray(br.readLine().split(" ")) parceIntArray br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " Score score = new Score(arr[0], arr[1], arr[2]); score new Score(arr[0], arr[1], arr[2]) if(score.equals(new Score(-1, -1, -1))){
				break;
			}else{
				System.out.println(score.getGrade());
			} score.equals(new Score(-1, -1, -1)) score.equals score new Score(-1, -1, -1) {
				break;
			} break; {
				System.out.println(score.getGrade());
			} System.out.println(score.getGrade()) System.out.println System.out System System.out score.getGrade() score.getGrade score String[] args args private static int[] parceIntArray(String[] strArr){
		int[] arr = new int[strArr.length];
		for(int i = 0;i < arr.length;i++){
			arr[i] = Integer.parseInt(strArr[i]);
		}
		return arr;
	} parceIntArray {
		int[] arr = new int[strArr.length];
		for(int i = 0;i < arr.length;i++){
			arr[i] = Integer.parseInt(strArr[i]);
		}
		return arr;
	} int[] arr = new int[strArr.length]; arr new int[strArr.length] strArr.length strArr strArr.length for(int i = 0;i < arr.length;i++){
			arr[i] = Integer.parseInt(strArr[i]);
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			arr[i] = Integer.parseInt(strArr[i]);
		} {
			arr[i] = Integer.parseInt(strArr[i]);
		} arr[i] = Integer.parseInt(strArr[i]) arr[i] arr i Integer.parseInt(strArr[i]) Integer.parseInt Integer strArr[i] strArr i return arr; arr String[] strArr strArr class Score {
	int midterm;
	int term;
	int makeUp;

	Score(int midterm, int term, int makeUp) {
		this.midterm = midterm;
		this.term = term;
		this.makeUp = makeUp;
	}

	String getGrade() {
		int finalScore = midterm + term;
		String result;
		if (midterm == -1 || term == -1 || finalScore < 30) {
			result = "F";
		} else if (finalScore < 50) {
			if (makeUp >= 50) {
				result = "C";
			} else {
				result = "D";
			}
		}else if(finalScore < 65){
			result = "C";
		}else if(finalScore < 80){
			result = "B";
		}else{
			result = "A";
		}
		return result;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + makeUp;
		result = prime * result + midterm;
		result = prime * result + term;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Score other = (Score) obj;
		if (makeUp != other.makeUp)
			return false;
		if (midterm != other.midterm)
			return false;
		if (term != other.term)
			return false;
		return true;
	}
	
} Score int midterm; midterm int term; term int makeUp; makeUp Score(int midterm, int term, int makeUp) {
		this.midterm = midterm;
		this.term = term;
		this.makeUp = makeUp;
	} Score {
		this.midterm = midterm;
		this.term = term;
		this.makeUp = makeUp;
	} this.midterm = midterm this.midterm this this.midterm midterm this.term = term this.term this this.term term this.makeUp = makeUp this.makeUp this this.makeUp makeUp int midterm midterm int term term int makeUp makeUp String getGrade() {
		int finalScore = midterm + term;
		String result;
		if (midterm == -1 || term == -1 || finalScore < 30) {
			result = "F";
		} else if (finalScore < 50) {
			if (makeUp >= 50) {
				result = "C";
			} else {
				result = "D";
			}
		}else if(finalScore < 65){
			result = "C";
		}else if(finalScore < 80){
			result = "B";
		}else{
			result = "A";
		}
		return result;
	} getGrade {
		int finalScore = midterm + term;
		String result;
		if (midterm == -1 || term == -1 || finalScore < 30) {
			result = "F";
		} else if (finalScore < 50) {
			if (makeUp >= 50) {
				result = "C";
			} else {
				result = "D";
			}
		}else if(finalScore < 65){
			result = "C";
		}else if(finalScore < 80){
			result = "B";
		}else{
			result = "A";
		}
		return result;
	} int finalScore = midterm + term; finalScore midterm + term midterm term String result; result if (midterm == -1 || term == -1 || finalScore < 30) {
			result = "F";
		} else if (finalScore < 50) {
			if (makeUp >= 50) {
				result = "C";
			} else {
				result = "D";
			}
		}else if(finalScore < 65){
			result = "C";
		}else if(finalScore < 80){
			result = "B";
		}else{
			result = "A";
		} midterm == -1 || term == -1 || finalScore < 30 midterm == -1 || term == -1 || finalScore < 30 midterm == -1 midterm -1 1 term == -1 term -1 1 finalScore < 30 finalScore 30 {
			result = "F";
		} result = "F" result "F" if (finalScore < 50) {
			if (makeUp >= 50) {
				result = "C";
			} else {
				result = "D";
			}
		}else if(finalScore < 65){
			result = "C";
		}else if(finalScore < 80){
			result = "B";
		}else{
			result = "A";
		} finalScore < 50 finalScore 50 {
			if (makeUp >= 50) {
				result = "C";
			} else {
				result = "D";
			}
		} if (makeUp >= 50) {
				result = "C";
			} else {
				result = "D";
			} makeUp >= 50 makeUp 50 {
				result = "C";
			} result = "C" result "C" {
				result = "D";
			} result = "D" result "D" if(finalScore < 65){
			result = "C";
		}else if(finalScore < 80){
			result = "B";
		}else{
			result = "A";
		} finalScore < 65 finalScore 65 {
			result = "C";
		} result = "C" result "C" if(finalScore < 80){
			result = "B";
		}else{
			result = "A";
		} finalScore < 80 finalScore 80 {
			result = "B";
		} result = "B" result "B" {
			result = "A";
		} result = "A" result "A" return result; result @Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + makeUp;
		result = prime * result + midterm;
		result = prime * result + term;
		return result;
	} hashCode {
		final int prime = 31;
		int result = 1;
		result = prime * result + makeUp;
		result = prime * result + midterm;
		result = prime * result + term;
		return result;
	} final int prime = 31; prime 31 int result = 1; result 1 result = prime * result + makeUp result prime * result + makeUp prime * result prime result makeUp result = prime * result + midterm result prime * result + midterm prime * result prime result midterm result = prime * result + term result prime * result + term prime * result prime result term return result; result @Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Score other = (Score) obj;
		if (makeUp != other.makeUp)
			return false;
		if (midterm != other.midterm)
			return false;
		if (term != other.term)
			return false;
		return true;
	} equals {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Score other = (Score) obj;
		if (makeUp != other.makeUp)
			return false;
		if (midterm != other.midterm)
			return false;
		if (term != other.term)
			return false;
		return true;
	} if (this == obj)
			return true; this == obj this obj return true; true if (obj == null)
			return false; obj == null obj null return false; false if (getClass() != obj.getClass())
			return false; getClass() != obj.getClass() getClass() getClass obj.getClass() obj.getClass obj return false; false Score other = (Score) obj; other (Score) obj if (makeUp != other.makeUp)
			return false; makeUp != other.makeUp makeUp other.makeUp other other.makeUp return false; false if (midterm != other.midterm)
			return false; midterm != other.midterm midterm other.midterm other other.midterm return false; false if (term != other.term)
			return false; term != other.term term other.term other other.term return false; false return true; true Object obj obj public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int[] arr = parceIntArray(br.readLine().split(" "));
			Score score = new Score(arr[0], arr[1], arr[2]);
			if(score.equals(new Score(-1, -1, -1))){
				break;
			}else{
				System.out.println(score.getGrade());
			}
		}
	}
	
	private static int[] parceIntArray(String[] strArr){
		int[] arr = new int[strArr.length];
		for(int i = 0;i < arr.length;i++){
			arr[i] = Integer.parseInt(strArr[i]);
		}
		return arr;
	}
} public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int[] arr = parceIntArray(br.readLine().split(" "));
			Score score = new Score(arr[0], arr[1], arr[2]);
			if(score.equals(new Score(-1, -1, -1))){
				break;
			}else{
				System.out.println(score.getGrade());
			}
		}
	}
	
	private static int[] parceIntArray(String[] strArr){
		int[] arr = new int[strArr.length];
		for(int i = 0;i < arr.length;i++){
			arr[i] = Integer.parseInt(strArr[i]);
		}
		return arr;
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while(true){
			int[] arr = parceIntArray(br.readLine().split(" "));
			Score score = new Score(arr[0], arr[1], arr[2]);
			if(score.equals(new Score(-1, -1, -1))){
				break;
			}else{
				System.out.println(score.getGrade());
			}
		}
	}
	
	private static int[] parceIntArray(String[] strArr){
		int[] arr = new int[strArr.length];
		for(int i = 0;i < arr.length;i++){
			arr[i] = Integer.parseInt(strArr[i]);
		}
		return arr;
	}
}

class Score {
	int midterm;
	int term;
	int makeUp;

	Score(int midterm, int term, int makeUp) {
		this.midterm = midterm;
		this.term = term;
		this.makeUp = makeUp;
	}

	String getGrade() {
		int finalScore = midterm + term;
		String result;
		if (midterm == -1 || term == -1 || finalScore < 30) {
			result = "F";
		} else if (finalScore < 50) {
			if (makeUp >= 50) {
				result = "C";
			} else {
				result = "D";
			}
		}else if(finalScore < 65){
			result = "C";
		}else if(finalScore < 80){
			result = "B";
		}else{
			result = "A";
		}
		return result;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + makeUp;
		result = prime * result + midterm;
		result = prime * result + term;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Score other = (Score) obj;
		if (makeUp != other.makeUp)
			return false;
		if (midterm != other.midterm)
			return false;
		if (term != other.term)
			return false;
		return true;
	}
	
}