#include <iostream>
#include <string>
using namespace std;

int main()
{
	double t, u;
	string s;

	while (cin >> t >> u) {
		if (t < 35.5 && u < 71)
			s = "AAA";
		else if (t < 37.5 && u < 77)
			s = "AA";
		else if (t < 40 && u < 83)
			s = "A";
		else if (t < 43 && u < 89)
			s = "B";
		else if (t < 50 && u < 105)
			s = "C";
		else if (t < 55 && u < 116)
			s = "D";
		else if (t < 70 && u < 148)
			s = "E";
		else
			s = "NA";

		cout << s << endl;
	}

	return 0;
}
