import std.stdio;
import std.conv;
import std.array;
import std.string;

void main()
{
  while (1) {
    string[] input = split(readln());
    int m = to!(int)(input[0]);
    int f = to!(int)(input[1]);
    int r = to!(int)(input[2]);

    if ( m == -1 && f == -1 && r == -1) break;
    if (r == -1) r = 0;

    char g;
    if (m == -1 || f == -1) g = 'F';
    else if (m + f >= 80) g = 'A';
    else if (m + f >= 65 && m + f < 80) g = 'B';
    else if (m + f >= 50 && m + f < 65) g = 'C';
    else if (m + f >= 30 && m + f < 50) {
      if (r >= 50) g = 'C';
      else g = 'D';
    } else g = 'F';
    writeln(g);
  }
}