#include <stdio.h>
int main(void)
{
	float a,b,c;
	scanf("%f.2 %f\n.2",&a,&b);
	if(a<35.50&&b<71.00){
		printf("AAA\n",c);
	}
	else if(a<37.50&&b<77.00){
		printf("AA\n",c);
	}
	else if(a<40.00&&b<83.00){
		printf("A\n",c);
	}
	else if(a<43.00&&b<89.00){
		printf("B\n",c);
	}
	else if(a<50.00&&b<105.00){
		printf("C\n",c);
	}
	else if(a<55.00&&b<116.00){
		printf("D\n",c);
	}
	else if(a<70.00&&b<148.00){
		printf("E\n",c);
	}
	else {
		printf("NA\n",c);
	}
	return 0;
}