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