#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

double hoge[] = {35.5,37.5,40,43,50,55,70};
double hage[] = {71,77,83,89,105,116,148};
string s[] = {"AAA","AA","A","B","C","D","E","NA"};

int main() {
  double a,b;
  while(cin>>a>>b) {
    REP(i,8) {
      if (i==7 || a<hoge[i]&&b<hage[i]) {
        cout << s[i] << endl;
        break;
      }
    }
  }
}