#include <iostream>
using namespace std;

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