#include <iostream>
using namespace std;
int main()
{
  float f,g;
  while(cin >> f >> g){
    if (f < 35.5 && g < 71.0) cout << "AAA" << endl;
    else if(f < 37.5 && g < 77.0) cout << "AA" << endl;
    else if(f < 40.0 && g < 83.0) cout << "A" << endl;
    else if(f < 43.0 && g < 89.0) cout << "B" << endl;
    else if(f < 50.0 && g < 105.0) cout << "C" << endl;
    else if(f < 55.0 && g < 116.0) cout << "D" << endl;
    else if(f < 70.0 && g < 148.0) cout << "E" << endl;
    else cout << "NA" << endl;
  }
  return 0;
}