#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	double t1,t2;
	while (cin>>t1>>t2) {
		if (t1 < 35.50 && t2 < 71.00) {
			cout << "AAA" << endl;
		}
		else if (t1 < 37.50 && t2 < 77.00) {
			cout << "AA" << endl;
		}
		else if (t1 < 40.00 && t2 < 83.00) {
			cout << "A" << endl;
		}
		else if (t1 < 43.00 && t2 < 89.00) {
			cout << "B" << endl;
		}
		else if (t1 < 50.00 && t2 < 105.00) {
			cout << "C" << endl;
		}
		else if (t1 < 55.00 && t2 < 116.00) {
			cout << "D" << endl;
		}
		else if (t1 < 70.00 && t2 < 148.00) {
			cout << "E" << endl;
		}
		else  {
			cout << "NA" << endl;
		}
	}

return 0;
}