#include <iostream>
#include <string>
using namespace std;
#define rep2(x,from,to) for(int x=(from);x<(to);++(x))
#define rep(x,to) rep2(x,0,to)

int main() {
	double t1[] = {35.5, 37.5, 40, 43, 50, 55, 70};
	double t2[] = {71, 77, 83, 89, 105, 116, 148};
	string s[] = {"AAA", "AA", "A", "B", "C", "D", "E"};
	double a, b;
	while(cin >> a >> b) {
		bool f = 1;
		rep(i,7) {
			if(t1[i] > a && t2[i] > b) {
				cout << s[i] << endl;
				f = 0;
				break;
			}
		}
		if(f) cout << "NA" << endl;
	}
	return 0;
}