#include<iostream>

using namespace std;

int main(void){
	double sho,lon;
	while(cin>>sho>>lon){
		if(sho<35.50 && lon < 71.00)			cout<<"AAA";
		else if(sho < 37.50 && lon < 77.00)	cout<<"AA";
		else if(sho < 40.00 && lon < 83.00)	cout<<"A";
		else if(sho < 43.00 && lon < 89.00)	cout<<"B";
		else if(sho < 50.00 && lon < 105.00)cout<<"C";
		else if(sho < 55.00 && lon < 116.00)cout<<"D";
		else if(sho < 70.00 && lon < 148.00)cout<<"E";
		else cout<<"NA";
		cout<<endl;
	}

	
}