#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

int main () {
	double t1,t2;
	
	while(scanf("%lf %lf",&t1,&t2)!=EOF){
		if(t1<35.50&&t2<71.0)
		printf("AAA\n");
		else if(t1<37.50&&t2<77.0)
		printf("AA\n");
		else if(t1<40.0&&t2<83.0)
		printf("A\n");
		else if(t1<43.0&&t2<89.0)
		printf("B\n");
		else if(t1<50.0&&t2<105.0)
		printf("C\n");
		else if(t1<55.0&&t2<116.0)
		printf("D\n");
		else if(t1<70.0&&t2<148.0)
		printf("E\n");
		else
		printf("NA\n");
	}
}