#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;

int main(){
	double t1[7] = {35.5,37.5,40,43,50,55,70}, t2[7] = {71,77,83,89,105,116,148};
	double R1,R2;
	while(cin>>R1>>R2){
		int c1=7,c2=7;
		for(int i=6;i>=0;i--){
			if(R1<t1[i]) c1 = i;
			if(R2<t2[i]) c2 = i;
		}
		int c = max(c1,c2);
		if(c==0) puts("AAA");
		else if(c==1) puts("AA");
		else if(c==2) puts("A");
		else if(c==3) puts("B");
		else if(c==4) puts("C");
		else if(c==5) puts("D");
		else if(c==6) puts("E");
		else puts("NA");
	}
}