#include<iostream>
#include<string>
using namespace std;
double a, b;
double c[7] = { 35.5,37.5,40.0,43.0,50.0,55.0,70.0 };
double d[7] = { 71.0,77.0,83.0,89.0,105.0,116.0,148.0 };
string s[7] = { "AAA","AA","A","B","C","D","E" };
int main() {
	while (cin >> a >> b) {
		for (int i = 0; i < 7; i++) {
			if (a < c[i] && b < d[i]) {
				cout << s[i] << endl; goto E;
			}
		}
		cout << "NA" << endl;
	E:;
	}
}