#include <bits/stdc++.h>
using namespace std;

int main(){
	while(true){
		int m, f, r;
		char s;
		
		cin >> m >> f >> r;
		
		if(m==-1 && f==-1&& r==-1) break;
		
		if(m==-1 || f==-1) s = 'F';
		else if(m+f>=80) s = 'A';
		else if(m+f>=65) s = 'B';
		else if(m+f>=50) s = 'C';
		else if(m+f>=30){
			if(r>= 50) s = 'C';
			else s = 'D';
		}
		else s = 'F';
		
		cout << s << "\n";
	}
	return 0;
}
