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

int main() {
	int M, F, R;
	for (int a = 0; ; a++) {
		cin >> M >> F >> R;
		if (M == -1 && F == -1 && R == -1) break;
		if (M == -1 || F == -1) cout << "F";
		else if (M + F >= 80) cout << "A";
		else if (M + F >= 65) cout << "B";
		else if (M + F >= 50) cout << "C";
		else if (M + F >= 30) {
			if (R >= 50) cout << "C";
			else cout << "D";
		}
		else cout << "F";
		cout << endl;
	}
}
