#include<iostream>
using namespace std;

int main(){
	double x,y;
	while(cin>>x){
		cin>>y;
		if(x<35.5 && y<71.0)cout<<"AAA"<<endl;
		else if(x<37.5 && y<77.0)cout<<"AA"<<endl;
		else if(x<40.0 && y<83.0)cout<<"A"<<endl;
		else if(x<43.0 && y<89.0)cout<<"B"<<endl;
		else if(x<50.0 && y<105.0)cout<<"C"<<endl;
		else if(x<55.0 && y<116.0)cout<<"D"<<endl;
		else if(x<70.0 && y<148.0)cout<<"E"<<endl;
		else cout<<"NA"<<endl;
		}
	return 0;
}