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

double a, b;
double A[7] = {35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0};
double B[7] = {71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0};
string S[8] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"};

int main() {
  while(cin >> a >> b) {
    int ra, rb;
    for(ra = 0; ra < 7 && !(a < A[ra]); ++ra);
    for(rb = 0; rb < 7 && !(b < B[rb]); ++rb);
        cout << S[max(ra,rb)] << endl;
  }
  return 0;
}