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

int main() {
  double a, b;
  while (cin >> a >> b) {
    string s = "NA";
    if (a < 35.5 && b < 71.0)s = "AAA";
    else if (a < 37.5 && b < 77.0) s = "AA";
    else if (a < 40.0 && b < 83.0) s = "A";
    else if (a < 43.0 && b < 89.0) s = "B";
    else if (a < 50.0 && b < 105.0) s = "C";
    else if (a < 55.0 && b < 116.0) s = "D";
    else if (a < 70.0 && b < 148.0) s = "E";
    cout << s << "\n";
  }
}
