#include <iostream>
using namespace std;

int main(){
    double time[2];

    while(cin >> time[0] >> time[1]){
        if(time[0] < 35.5 && time[1] < 71.0) cout << "AAA" << endl;
        else if(time[0] < 37.5 && time[1] < 77.0) cout << "AA" << endl;
        else if(time[0] < 40.0 && time[1] < 83.0) cout << "A" << endl;
        else if(time[0] < 43.0 && time[1] < 89.0) cout << "B" << endl;
        else if(time[0] < 50.0 && time[1] < 105.0) cout << "C" << endl;
        else if(time[0] < 55.0 && time[1] < 116.0) cout << "D" << endl;
        else if(time[0] < 70.0 && time[1] < 148.0) cout << "E" << endl;
        else cout << "NA" << endl;
    }
    return 0;
}