#include <iostream>
using namespace std;

double border[7][2] =
{
    {35.50, 71.00},
    {37.50, 77.00},
    {40.00, 83.00},
    {43.00, 89.00},
    {50.00, 105.00},
    {55.00, 116.00},
    {70.00, 148.00}
};
string name[8] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"};

int main(){
    double a, b;
    int i;
    while( cin >> a >> b ){
        for(i = 0; i < 7; i++){
            if( a < border[i][0] && b < border[i][1] ){
                break;
            }
        }
        cout << name[i] << endl;
    }
    return 0;
}