#include<iostream>
using namespace std;

int h[] = {35, 37, 40, 43, 50, 55, 70};
int f[] = {71, 77, 83, 89, 105, 116, 148};
string s[] = {"AAA", "AA", "A", "B", "C", "D", "E"};

int main()
{
  double a, b;
  while(cin >> a >> b)
  {
    for(int i = 0; i < 7; i++)
    {
      if(a < h[i] && b < f[i])
      {
        cout << s[i] << endl;
        goto next;
      }
    }
    cout << "NA\n";
  next:;
  }
}