#include <iostream>

using namespace std;

int main()
{
    double f, s;
    
    while (cin >> f >> s) {
        if (f < 35.5 && s < 71)
            cout << "AAA";
        else if (f < 37.5 && s < 77.0)
            cout << "AA";
        else if (f < 40.0 && s < 83.0)
            cout << "A";
        else if (f < 43.0 && s < 89.0)
            cout << "B";
        else if (f < 50.0 && s < 105.0)
            cout << "C";
        else if (f < 55.0 && s < 116.0)
            cout << "D";
        else if (f < 70.0 && s < 148.0)
            cout << "E";
        else
            cout << "NA";
        
        cout << endl;
    }

    return 0;
}