#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF         1e9
#define INFLL       1e18
#define EPS         1e-9
#define REP(i,n)    for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(ll i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP(n)     cout<<fixed<<setprecision(n)
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

signed main()
{
	double t1, t2;
	while (cin >> t1 >> t2) {
		cout << (
			t1 < 35.50 && t2 < 71.00 ? "AAA" :
			t1 < 37.50 && t2 < 77.00 ? "AA" :
			t1 < 40.00 && t2 < 83.00 ? "A" :
			t1 < 43.00 && t2 < 89.00 ? "B" :
			t1 < 50.00 && t2 < 105.00 ? "C" :
			t1 < 55.00 && t2 < 116.00 ? "D" :
			t1 < 70.00 && t2 < 148.00 ? "E" : "NA"
			) << endl;
	}
}

