#include <iostream>

using namespace std;

int main()
{
int a,b,c;
for(int i=1;i<=1000;i++)
{cin >> a >> b >> c;
if(a==-1 && b==-1)
{cout << "";}
else if(a==-1)
{cout << "F" << endl;}
else if(b==-1)
{cout << "F" << endl;}
else if(a+b<30)
{cout << "F" << endl;}
else if(a+b<50)
{if(c>=50)
{cout << "C" << endl;}
else
{cout << "D" << endl;}
}
else if(a+b<65)
{cout << "C" << endl;}
else if(a+b<80)
{cout << "B" << endl;}
else
{cout << "A" << endl;}
}
}
