#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
string getRank(int idx)
{
    string res = "";
    if(idx == 0) res += "NA"; 
    if(idx == 1) res += "E";
    if(idx == 2) res += "D";
    if(idx == 3) res += "C";
    if(idx == 4) res += "B";
    if(idx == 5) res += "A";
    if(idx == 6) res += "AA";
    if(idx == 7) res += "AAA";
    return res;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    double a, b;
    pair<double, double> p[] = {{70, 148},{55, 116},{50, 105},{43, 89},{40, 83},{37.50, 77},{35.50, 71}};
    while(cin >> a >> b)
    {
        int i;
        for(i = 0; i < 7; i++)
        {
            if(a >= p[i].first || b >= p[i].second)
            {
                cout << getRank(i) << endl;
                break;
            }
        }
        if(i == 7) cout << getRank(i) << endl;
    }
    return 0;
}


