#include<iostream>
using namespace std;

int main()
{
    double a, b;

    while( cin >> a >> b )
    {
        if( a - 35.50 < 0 && b - 71 < 0 )
            cout << "AAA";
        else if( a - 37.50 < 0 && b - 77 < 0 )
            cout << "AA";
        else if( a - 40 < 0 && b - 83 < 0 )
            cout << "A";
        else if( a - 43 < 0 && b - 89 < 0 )
            cout << "B";
        else if( a - 50 < 0 && b - 105 < 0 )
            cout << "C";
        else if( a - 55 < 0 && b - 116 < 0 )
            cout << "D";
        else if( a - 70 < 0 && b - 148 < 0 )
            cout << "E";
        else
            cout << "NA";
        cout << endl;
    }
    return 0;
}
