#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  while (1) {
    cin >> a >> b >> c;
    if (a == -1 && b == -1 && c == -1) break;
    if ((a == -1 || b == -1) || (a + b < 30)) cout << "F" << endl;
    if (a + b >= 80) cout << "A" << endl;
    if (a + b >= 65 && a + b < 80) cout << "B" << endl;
    if ((a + b >= 50 && a + b < 65) || (a + b >= 30 && a + b < 50 && c >= 50))
      cout << "C" << endl;
    if (a + b >= 30 && a + b < 50 && c < 50 && a != -1 && b != -1)
      cout << "D" << endl;
  }
  return 0;
}
