#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <fstream>
#include <sstream>
#include <math.h>
#include <queue>
#include <stack>
#include <math.h>


using namespace std;

double five_hundred[7]={35.50, 37.50, 40.0, 43.0, 50.0, 55.0, 70.0};
double thousand[7]={71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0};
string test_class[7]={"AAA", "AA", "A", "B", "C", "D", "E"};
int main(){
    double a,b;
    while(cin>>a>>b){
        for(int i=0; i<=7; i++){
            if(i==7){
                cout<<"NA"<<endl;
                break;
            }else if(five_hundred[i]>a&&thousand[i]>b){
                cout<<test_class[i]<<endl;
                break;
            }
        }
    }
    
}