#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

double afive[7] = {35.5, 37.5, 40, 43, 50, 55, 70};
double athou[7] = {71, 77, 83, 89, 105, 116, 148};
string grade[8] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"};

int main() {
    vector<double> five(7), thou(7);
    for (int i = 0; i < 7; ++i) {
        five[i] = afive[i];
        thou[i] = athou[i];
    }
    
    double a, b;
    while (cin >> a >> b) {
        int da = upper_bound(five.begin(), five.end(), a) - five.begin();
        int db = upper_bound(thou.begin(), thou.end(), b) - thou.begin();
        int res = max(da, db);
        cout << grade[res] << endl;
    }
}
