#include <cstdio>
#include <string>
#include <iostream>

using namespace std;

int main()
{
    double t1,t2;
    while( scanf( "%lf %lf\n", &t1, &t2 ) != EOF )
    {
        printf( "%lf %lf\n", t1, t2  );
        const double bound_1[7] = {35.5,37.5,40,43,50,55,70};
        const double bound_2[7] = {71,77,83,89,105,116,148};
        const string c[7] = {"AAA","AA","A","B","C","D","E"};
        int i = 0, num;
        while( 1 )
        {
            if( t1 < bound_1[i] && t2 < bound_2[i] ){
                cout << c[i] << endl;
                break;
            }
            if( i > 7 )
            {
                printf( "NA\n");
                break;
            }
            i++;
        }
        /* for( int i = 0; i < 7; i++ )
        {
            if( t1 > bound_1[i] )
            {
                num1 = i;
            }
            if( t2 > bound_2[i] )
            {
                num2 = i;
            }
        } */
       
    }
    return 0;
}
