#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<math.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<string>
#include<cmath>
#include<set>
#include<stack>

using namespace std;

int main()
{
    float a[7]={35.50,37.50,40,43,50,55,70};
    float b[7]={71,77,83,89,105,116,148};
    string c[7]={"AAA","AA","A","B","C","D","E"};
    float x,y;
    while(cin>>x>>y) {
        for(int i=0;i<7;i++){
            if(a[i]<=x)continue;
            for(int j=0;j<7;j++){
                if(b[j]>y){
                    cout<<c[max(i,j)]<<endl;
                    goto ne;
                }
            }
        }
        cout<<"NA"<<endl;
    ne:;
    }
//    freopen("/Users/shitian/Desktop/gcj/gcj/B-large-practice.in", "r", stdin);
//    freopen("/Users/shitian/Desktop/gcj/gcj/out.txt", "w", stdout);
//    int tcase;
//    cin>>tcase;
//    for(int tca=1;tca<=tcase;tca++){
//        cout<<"Case #"<<tca<<": ";
//
//    }
    return 0;
}