
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();
			String[] strArr = str.split(" ");
			int m = Integer.parseInt(strArr[0]);
			int f = Integer.parseInt(strArr[1]);
			int r = Integer.parseInt(strArr[2]);

			List<String> scores = new ArrayList<String>();
			int sum = 0;
			boolean yasumi=false;
			while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			}

			for(String s : scores){
				System.out.println(s);
			}

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();
			String[] strArr = str.split(" ");
			int m = Integer.parseInt(strArr[0]);
			int f = Integer.parseInt(strArr[1]);
			int r = Integer.parseInt(strArr[2]);

			List<String> scores = new ArrayList<String>();
			int sum = 0;
			boolean yasumi=false;
			while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			}

			for(String s : scores){
				System.out.println(s);
			}

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}
} Main public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();
			String[] strArr = str.split(" ");
			int m = Integer.parseInt(strArr[0]);
			int f = Integer.parseInt(strArr[1]);
			int r = Integer.parseInt(strArr[2]);

			List<String> scores = new ArrayList<String>();
			int sum = 0;
			boolean yasumi=false;
			while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			}

			for(String s : scores){
				System.out.println(s);
			}

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();
			String[] strArr = str.split(" ");
			int m = Integer.parseInt(strArr[0]);
			int f = Integer.parseInt(strArr[1]);
			int r = Integer.parseInt(strArr[2]);

			List<String> scores = new ArrayList<String>();
			int sum = 0;
			boolean yasumi=false;
			while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			}

			for(String s : scores){
				System.out.println(s);
			}

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {

			String str = br.readLine();
			String[] strArr = str.split(" ");
			int m = Integer.parseInt(strArr[0]);
			int f = Integer.parseInt(strArr[1]);
			int r = Integer.parseInt(strArr[2]);

			List<String> scores = new ArrayList<String>();
			int sum = 0;
			boolean yasumi=false;
			while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			}

			for(String s : scores){
				System.out.println(s);
			}

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		} try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			} catch (IOException ioe) {
			} IOException ioe {
			} {
				if (br != null) {
					br.close();
				}
			} if (br != null) {
					br.close();
				} br != null br null {
					br.close();
				} br.close() br.close br {

			String str = br.readLine();
			String[] strArr = str.split(" ");
			int m = Integer.parseInt(strArr[0]);
			int f = Integer.parseInt(strArr[1]);
			int r = Integer.parseInt(strArr[2]);

			List<String> scores = new ArrayList<String>();
			int sum = 0;
			boolean yasumi=false;
			while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			}

			for(String s : scores){
				System.out.println(s);
			}

		} String str = br.readLine(); str br.readLine() br.readLine br String[] strArr = str.split(" "); strArr str.split(" ") str.split str " " int m = Integer.parseInt(strArr[0]); m Integer.parseInt(strArr[0]) Integer.parseInt Integer strArr[0] strArr 0 int f = Integer.parseInt(strArr[1]); f Integer.parseInt(strArr[1]) Integer.parseInt Integer strArr[1] strArr 1 int r = Integer.parseInt(strArr[2]); r Integer.parseInt(strArr[2]) Integer.parseInt Integer strArr[2] strArr 2 List<String> scores = new ArrayList<String>(); scores new ArrayList<String>() int sum = 0; sum 0 boolean yasumi=false; yasumi false while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			} !( m==-1 && f==-1 && r==-1) ( 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 {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			} sum = m+f sum m+f m f yasumi = m==-1 || f==-1 yasumi m==-1 || f==-1 m==-1 m -1 1 f==-1 f -1 1 if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				} !yasumi && 80<=sum !yasumi yasumi 80<=sum 80 sum {
					scores.add("A");
				} scores.add("A") scores.add scores "A" if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				} !yasumi && 65<=sum !yasumi yasumi 65<=sum 65 sum {
					scores.add("B");
				} scores.add("B") scores.add scores "B" if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				} !yasumi && (50<=sum || (sum<50 && 50<=r)) !yasumi yasumi (50<=sum || (sum<50 && 50<=r)) 50<=sum 50 sum (sum<50 && 50<=r) sum<50 sum 50 50<=r 50 r {
					scores.add("C");
				} scores.add("C") scores.add scores "C" if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				} !yasumi && 30<=sum !yasumi yasumi 30<=sum 30 sum {
					scores.add("D");
				} scores.add("D") scores.add scores "D" {
					scores.add("F");
				} scores.add("F") scores.add scores "F" str = br.readLine() str br.readLine() br.readLine br strArr = str.split(" ") strArr str.split(" ") str.split str " " m = Integer.parseInt(strArr[0]) m Integer.parseInt(strArr[0]) Integer.parseInt Integer strArr[0] strArr 0 f = Integer.parseInt(strArr[1]) f Integer.parseInt(strArr[1]) Integer.parseInt Integer strArr[1] strArr 1 r = Integer.parseInt(strArr[2]) r Integer.parseInt(strArr[2]) Integer.parseInt Integer strArr[2] strArr 2 for(String s : scores){
				System.out.println(s);
			} String s scores {
				System.out.println(s);
			} {
				System.out.println(s);
			} System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();
			String[] strArr = str.split(" ");
			int m = Integer.parseInt(strArr[0]);
			int f = Integer.parseInt(strArr[1]);
			int r = Integer.parseInt(strArr[2]);

			List<String> scores = new ArrayList<String>();
			int sum = 0;
			boolean yasumi=false;
			while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			}

			for(String s : scores){
				System.out.println(s);
			}

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}
} public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();
			String[] strArr = str.split(" ");
			int m = Integer.parseInt(strArr[0]);
			int f = Integer.parseInt(strArr[1]);
			int r = Integer.parseInt(strArr[2]);

			List<String> scores = new ArrayList<String>();
			int sum = 0;
			boolean yasumi=false;
			while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			}

			for(String s : scores){
				System.out.println(s);
			}

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}
} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		try {

			String str = br.readLine();
			String[] strArr = str.split(" ");
			int m = Integer.parseInt(strArr[0]);
			int f = Integer.parseInt(strArr[1]);
			int r = Integer.parseInt(strArr[2]);

			List<String> scores = new ArrayList<String>();
			int sum = 0;
			boolean yasumi=false;
			while (!( m==-1 && f==-1 && r==-1)) {

				sum = m+f;
				yasumi = m==-1 || f==-1;

				if(!yasumi && 80<=sum){
					scores.add("A");
				}else if(!yasumi && 65<=sum){
					scores.add("B");
				}else if(!yasumi && (50<=sum || (sum<50 && 50<=r))){
					scores.add("C");
				}else if(!yasumi && 30<=sum){
					scores.add("D");
				}else{
					scores.add("F");
				}

				str = br.readLine();
				strArr = str.split(" ");
				m = Integer.parseInt(strArr[0]);
				f = Integer.parseInt(strArr[1]);
				r = Integer.parseInt(strArr[2]);

				;
			}

			for(String s : scores){
				System.out.println(s);
			}

		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (br != null) {
					br.close();
				}
			} catch (IOException ioe) {
			}

		}
	}
}