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) {

		new Main().run();

	}

	public void run(){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String inputData;
        List<TestResult> testDataList = new ArrayList<TestResult>();

        try {
        	//??\???
	        while(true){
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        }

	        //????????????
	        for(TestResult result :testDataList){
	        	System.out.println(result.getEvaluation());
	        }

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	/**
	 * TestResult?????????
	 * ??????????¨?????????°?????????????¨?????????°??????????¨?????????°
	 */
	class TestResult{

		//??????????¨?????????°
		public int m;
		//??????????¨?????????°
		public int f;
		//???????¨?????????°
		public int r;

		public String evalution;

		TestResult(int _m ,int _f,int _r){
			m = _m;
			f = _f;
			r = _r;

			setEvalution();

		}

		/**
		 * ??????????±????
		 */
		private void setEvalution(){

			int total = m + f;
			if(m == -1 || f == -1){
				evalution = "F";
			}else if(total >= 80){
				evalution = "A";
			}else if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			}
		}

		/**
		 * ???????????????
		 * @return
		 */
		public String getEvaluation(){

			return evalution;

		}

	}

} 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) {

		new Main().run();

	}

	public void run(){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String inputData;
        List<TestResult> testDataList = new ArrayList<TestResult>();

        try {
        	//??\???
	        while(true){
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        }

	        //????????????
	        for(TestResult result :testDataList){
	        	System.out.println(result.getEvaluation());
	        }

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	/**
	 * TestResult?????????
	 * ??????????¨?????????°?????????????¨?????????°??????????¨?????????°
	 */
	class TestResult{

		//??????????¨?????????°
		public int m;
		//??????????¨?????????°
		public int f;
		//???????¨?????????°
		public int r;

		public String evalution;

		TestResult(int _m ,int _f,int _r){
			m = _m;
			f = _f;
			r = _r;

			setEvalution();

		}

		/**
		 * ??????????±????
		 */
		private void setEvalution(){

			int total = m + f;
			if(m == -1 || f == -1){
				evalution = "F";
			}else if(total >= 80){
				evalution = "A";
			}else if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			}
		}

		/**
		 * ???????????????
		 * @return
		 */
		public String getEvaluation(){

			return evalution;

		}

	}

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

		new Main().run();

	} main {

		new Main().run();

	} new Main().run() new Main().run new Main() String[] args args public void run(){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String inputData;
        List<TestResult> testDataList = new ArrayList<TestResult>();

        try {
        	//??\???
	        while(true){
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        }

	        //????????????
	        for(TestResult result :testDataList){
	        	System.out.println(result.getEvaluation());
	        }

		} catch (IOException e) {
			e.printStackTrace();
		}

	} run {

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String inputData;
        List<TestResult> testDataList = new ArrayList<TestResult>();

        try {
        	//??\???
	        while(true){
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        }

	        //????????????
	        for(TestResult result :testDataList){
	        	System.out.println(result.getEvaluation());
	        }

		} catch (IOException e) {
			e.printStackTrace();
		}

	} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) String inputData; inputData List<TestResult> testDataList = new ArrayList<TestResult>(); testDataList new ArrayList<TestResult>() try {
        	//??\???
	        while(true){
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        }

	        //????????????
	        for(TestResult result :testDataList){
	        	System.out.println(result.getEvaluation());
	        }

		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
        	//??\???
	        while(true){
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        }

	        //????????????
	        for(TestResult result :testDataList){
	        	System.out.println(result.getEvaluation());
	        }

		} while(true){
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        } true {
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        } inputData = reader.readLine() inputData reader.readLine() reader.readLine reader if("-1 -1 -1".equals(inputData)){
					break;
				} "-1 -1 -1".equals(inputData) "-1 -1 -1".equals "-1 -1 -1" inputData {
					break;
				} break; String[] strData = inputData.split(" "); strData inputData.split(" ") inputData.split inputData " " testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2]))) testDataList.add testDataList new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])) for(TestResult result :testDataList){
	        	System.out.println(result.getEvaluation());
	        } TestResult result testDataList {
	        	System.out.println(result.getEvaluation());
	        } {
	        	System.out.println(result.getEvaluation());
	        } System.out.println(result.getEvaluation()) System.out.println System.out System System.out result.getEvaluation() result.getEvaluation result class TestResult{

		//??????????¨?????????°
		public int m;
		//??????????¨?????????°
		public int f;
		//???????¨?????????°
		public int r;

		public String evalution;

		TestResult(int _m ,int _f,int _r){
			m = _m;
			f = _f;
			r = _r;

			setEvalution();

		}

		/**
		 * ??????????±????
		 */
		private void setEvalution(){

			int total = m + f;
			if(m == -1 || f == -1){
				evalution = "F";
			}else if(total >= 80){
				evalution = "A";
			}else if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			}
		}

		/**
		 * ???????????????
		 * @return
		 */
		public String getEvaluation(){

			return evalution;

		}

	} TestResult //??????????¨?????????°
		public int m; m //??????????¨?????????°
		public int f; f //???????¨?????????°
		public int r; r public String evalution; evalution TestResult(int _m ,int _f,int _r){
			m = _m;
			f = _f;
			r = _r;

			setEvalution();

		} TestResult {
			m = _m;
			f = _f;
			r = _r;

			setEvalution();

		} m = _m m _m f = _f f _f r = _r r _r setEvalution() setEvalution int _m _m int _f _f int _r _r /**
		 * ??????????±????
		 */
		private void setEvalution(){

			int total = m + f;
			if(m == -1 || f == -1){
				evalution = "F";
			}else if(total >= 80){
				evalution = "A";
			}else if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			}
		} setEvalution {

			int total = m + f;
			if(m == -1 || f == -1){
				evalution = "F";
			}else if(total >= 80){
				evalution = "A";
			}else if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			}
		} int total = m + f; total m + f m f if(m == -1 || f == -1){
				evalution = "F";
			}else if(total >= 80){
				evalution = "A";
			}else if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			} m == -1 || f == -1 m == -1 m -1 1 f == -1 f -1 1 {
				evalution = "F";
			} evalution = "F" evalution "F" if(total >= 80){
				evalution = "A";
			}else if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			} total >= 80 total 80 {
				evalution = "A";
			} evalution = "A" evalution "A" if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			} total < 80 && total >=65 total < 80 total 80 total >=65 total 65 {
				evalution = "B";
			} evalution = "B" evalution "B" if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			} total < 65 && total >=50 total < 65 total 65 total >=50 total 50 {
				evalution = "C";
			} evalution = "C" evalution "C" if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			} total < 50 && total >=30 total < 50 total 50 total >=30 total 30 {
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			} if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				} r >= 50 r 50 {
					evalution = "C";
				} evalution = "C" evalution "C" {
					evalution = "D";
				} evalution = "D" evalution "D" if(total < 30){
				evalution = "F";
			} total < 30 total 30 {
				evalution = "F";
			} evalution = "F" evalution "F" /**
		 * ???????????????
		 * @return
		 */
		public String getEvaluation(){

			return evalution;

		} getEvaluation {

			return evalution;

		} return evalution; evalution public class Main {

	public static void main(String[] args) {

		new Main().run();

	}

	public void run(){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String inputData;
        List<TestResult> testDataList = new ArrayList<TestResult>();

        try {
        	//??\???
	        while(true){
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        }

	        //????????????
	        for(TestResult result :testDataList){
	        	System.out.println(result.getEvaluation());
	        }

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	/**
	 * TestResult?????????
	 * ??????????¨?????????°?????????????¨?????????°??????????¨?????????°
	 */
	class TestResult{

		//??????????¨?????????°
		public int m;
		//??????????¨?????????°
		public int f;
		//???????¨?????????°
		public int r;

		public String evalution;

		TestResult(int _m ,int _f,int _r){
			m = _m;
			f = _f;
			r = _r;

			setEvalution();

		}

		/**
		 * ??????????±????
		 */
		private void setEvalution(){

			int total = m + f;
			if(m == -1 || f == -1){
				evalution = "F";
			}else if(total >= 80){
				evalution = "A";
			}else if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			}
		}

		/**
		 * ???????????????
		 * @return
		 */
		public String getEvaluation(){

			return evalution;

		}

	}

} public class Main {

	public static void main(String[] args) {

		new Main().run();

	}

	public void run(){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String inputData;
        List<TestResult> testDataList = new ArrayList<TestResult>();

        try {
        	//??\???
	        while(true){
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        }

	        //????????????
	        for(TestResult result :testDataList){
	        	System.out.println(result.getEvaluation());
	        }

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	/**
	 * TestResult?????????
	 * ??????????¨?????????°?????????????¨?????????°??????????¨?????????°
	 */
	class TestResult{

		//??????????¨?????????°
		public int m;
		//??????????¨?????????°
		public int f;
		//???????¨?????????°
		public int r;

		public String evalution;

		TestResult(int _m ,int _f,int _r){
			m = _m;
			f = _f;
			r = _r;

			setEvalution();

		}

		/**
		 * ??????????±????
		 */
		private void setEvalution(){

			int total = m + f;
			if(m == -1 || f == -1){
				evalution = "F";
			}else if(total >= 80){
				evalution = "A";
			}else if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			}
		}

		/**
		 * ???????????????
		 * @return
		 */
		public String getEvaluation(){

			return evalution;

		}

	}

} 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) {

		new Main().run();

	}

	public void run(){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String inputData;
        List<TestResult> testDataList = new ArrayList<TestResult>();

        try {
        	//??\???
	        while(true){
				inputData = reader.readLine();
				if("-1 -1 -1".equals(inputData)){
					break;
				}
				String[] strData = inputData.split(" ");
				testDataList.add(new TestResult(Integer.parseInt(strData[0]) , Integer.parseInt(strData[1]) , Integer.parseInt(strData[2])));
	        }

	        //????????????
	        for(TestResult result :testDataList){
	        	System.out.println(result.getEvaluation());
	        }

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	/**
	 * TestResult?????????
	 * ??????????¨?????????°?????????????¨?????????°??????????¨?????????°
	 */
	class TestResult{

		//??????????¨?????????°
		public int m;
		//??????????¨?????????°
		public int f;
		//???????¨?????????°
		public int r;

		public String evalution;

		TestResult(int _m ,int _f,int _r){
			m = _m;
			f = _f;
			r = _r;

			setEvalution();

		}

		/**
		 * ??????????±????
		 */
		private void setEvalution(){

			int total = m + f;
			if(m == -1 || f == -1){
				evalution = "F";
			}else if(total >= 80){
				evalution = "A";
			}else if(total < 80 && total >=65){
				evalution = "B";
			}else if(total < 65 && total >=50){
				evalution = "C";
			}else if(total < 50 && total >=30){
				if(r >= 50){
					evalution = "C";
				}else{
					evalution = "D";
				}
			}else if(total < 30){
				evalution = "F";
			}
		}

		/**
		 * ???????????????
		 * @return
		 */
		public String getEvaluation(){

			return evalution;

		}

	}

}