#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>
#include<set>

using namespace std;


void Solution()
{
    double a,b;
    
    while(cin>>a>>b)
    {
        if(a < 35.5 && b < 71)
        {
            cout<<"AAA"<<endl;
        }
        else if(a < 37.5 && b < 77)
        {
            cout<<"AA"<<endl;
        }
        else if(a < 40 && b < 83)
        {
            cout<<"A"<<endl;
        }
        else if(a < 43 && b < 89)
        {
            cout<<"B"<<endl;
        }
        else if(a < 50 && b < 105)
        {
            cout<<"C"<<endl;
        }
        else if(a < 55 && b < 116)
        {
            cout<<"D"<<endl;
        }
        else if(a < 70 && b < 148)
        {
            cout<<"E"<<endl;
        }
        else
        {
            cout<<"NA"<<endl;
        }
    }
}

int main()
{
    Solution();
    return 0;
}