#include<iostream>
#include<string>
using namespace std;
int main() {
	int m=0,f=0,r=0;
	char s;
	while(1){
		cin>>m>>f>>r;
		if(m==-1&&f==-1&&r==-1)break;
		if((m==-1||f==-1)||((m+f)<30)){
			s='F';
		}
		else if(80<=(m+f)){
			s='A';
		}
		else if(65<=(m+f)){
			s='B';
		}
		else if(50<=(m+f)){
			s='C';
		}
		else if(30<=(m+f)){
			s='D';
			if(50<=r){
				s='C';
			}
		}
		else if((m==-1||f==-1)||((m+f)<30)){
			s='F';
		}
		cout<<s<<endl;
		
	}
}

