#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>

using namespace std;

typedef pair<double, double> P2;
typedef pair<string, P2> P;

int main() {
	vector<P> st;
	st.push_back(  P("AAA", P2(35.50, 71.00) )   );
	st.push_back(  P("AA",  P2(37.50, 77.00) )   );
	st.push_back(  P("A",   P2(40.00, 83.00) )   );
	st.push_back(  P("B",   P2(43.00, 89.00) )   );
	st.push_back(  P("C",   P2(50.00, 105.00) )  );
	st.push_back(  P("D",   P2(55.00, 116.00) )  );
	st.push_back(  P("E",   P2(70.00, 148.00) )  );

	double a, b;
	while (scanf("%lf%lf", &a, &b) != EOF) {
		bool f = false;
		for (int i = 0; i < st.size(); ++i) {
			if (a < st[i].second.first && b < st[i].second.second) {
				cout << st[i].first << endl;
				f = true;
				break;
			}
		}
		if (!f) cout << "NA" << endl;
	}
}