#include<iostream>
using namespace std;
int main(){
	double m,k;
	while(cin>>m>>k){
		if(m<35.5&&k<71.0)
			cout<<"AAA"<<endl;
		else if(m<37.5&&k<77.0)
			cout<<"AA"<<endl;
		else if(m<40.0&&k<83.0)
			cout<<"A"<<endl;
		else if(m<43.0&&k<89.0)
			cout<<"B"<<endl;
		else if(m<50.0&&k<105.0)
			cout<<"C"<<endl;
		else if(m<55.0&&k<116.0)
			cout<<"D"<<endl;
		else if(m<70.0&&k<148.0)
			cout<<"E"<<endl;
		else cout<<"NA"<<endl;
	}
}