#include <cstdio>
#include <algorithm>
#include <string>
using namespace std;

int main() {
	double s, g;
	string out;
	scanf(" %lf %lf", &s, &g);
	if(s < 35.50 && g < 71.00) out = "AAA";
	else if(s < 37.0 && g < 77.00) out = "AA";
	else if(s < 40.0 && g < 83.00) out = "A";
	else if(s < 43.0 && g < 89.00) out = "B";
	else if(s < 50.0 && g < 105.00) out = "C";
	else if(s < 55.0 && g < 116.00) out = "D";
	else if(s < 70.0 && g < 148.00) out = "E";
	else out = "NA";
	printf("%s\n", out.c_str());
	return 0;
}