#include<cstdio>
#include<string>
main(){
	using namespace std;
	int i,j;
	string lv[8] = {"AAA","AA","A","B","C","D","E","NA"};
	double lvd5[7] = {35.5,37.5,40.0,43.0,50.0,55.0,70.0};
	int lvd1[7] = {71,77,83,89,105,116,148};
	double ind1,ind2;
	while(~scanf("%lf %lf",&ind1,&ind2)){
		i = j = 0;
		while(i<7){
			if(ind1 < lvd5[i])
				break;
			i++;
		}
		while(j<7){
			if(ind2 < lvd1[j])
				break;
			j++;
		}
		printf("%s\n", i <= j ? lv[j].c_str() : lv[i].c_str());
	}
	return 0;
}