#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

using P = pair<double, double>;
map<string, P> mp;

void init() {
  mp["AAA"] = {35.5, 71.0};
  mp["AA"] = {37.5, 77.0};
  mp["A"] = {40.0, 83.0};
  mp["B"] = {43.0, 89.0};
  mp["C"] = {50.0, 105.0};
  mp["D"] = {55.0, 116.0};
  mp["E"] = {70.0, 148.0};
}

bool operator < (const P& a, const P& b) {
  return (a.first - b.first < -1e-10) && (a.second - b.second < -1e-10);
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  init();
  vector<string> s = {"AAA", "AA", "A", "B", "C", "D", "E"};
  P a;
  while (cin >> a.first >> a.second) {
    string ans = "NA";
    for (int i = 0; i < 7; i++) {
      if (a < mp[s[i]]) {
        ans = s[i];
        break;
      }
    }
    cout << ans << endl;
  }

  return 0;
}
