#include<iostream>

using namespace std;

int main(){
  double R5,R10;

  while(cin >> R5 >> R10){
    if(R5 < 35.50 && R10 < 77.00){
      cout << "AAA" << endl;
    }
    else if(R5 < 37.50 && R10 < 77.00){
      cout << "AA" << endl;
    }
    else if(R5 < 40.00 && R10 < 83.00){
      cout << "A" << endl;
    }
    else if(R5 < 43.00 && R10 < 89.00){
      cout << "B" << endl;
    }
    else if(R5 < 50.00 && R10 < 105.00){
      cout << "C" << endl;
    }
    else if(R5 < 55.00 && R10 < 116.00){
      cout << "D" << endl; 
    }
    else if(R5 < 70.00 && R10 < 148.00){
      cout << "E" << endl;
    }
    else{
      cout << "NA" << endl;
    }

  }
  return 0;
}