#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

const float m500[] = {
  35.5f, 37.5f, 40.0f, 43.0f, 50.0f, 55.0f, 70.0f, (float)(1<<30)
};
const float m1k[] = {
  71.0f, 77.0f, 83.0f, 89.0f, 105.f, 116.f, 148.0f, (float)(1<<30)
};
const string rank[] = {
  "AAA", "AA", "A", "B", "C", "D", "E", "NA"
};

int main() {
  const int sz = 8;
  float l, r;
  while (cin >> l >> r) {
    int ll = upper_bound(m500, m500 + sz, l) - m500;
    int rl = upper_bound(m1k, m1k + sz, r) - m1k;
    cout << rank[max(rl,ll)] << endl;
  }
  return 0;
}