#include <iostream>
#include <string>
using namespace std;

int main() {
  double data[7][2] = {{35.50, 71.0},
		       {37.50, 77.0},
		       {40.0 , 83.0},
		       {43.0 , 89.0},
		       {50.0 , 105.0},
		       {55.0 , 116.0},
		       {70.0 , 148.0}};
  string level[7] = {"AAA", "AA", "A", "B", "C", "D", "E"};
  double t500, t1000;
  while(cin >> t500 >> t1000) {
    for(int i = 0; i < 7; i++) {
      if(t500 < data[i][0] && t1000 < data[i][1]) {
	cout << level[i] << endl;
	break;
      }
      if(i+1 == 7) cout << "NA" << endl;
    }
  }
  return 0;
}