#include<iostream>
using namespace std;
int main(){
	double x,y;
	while(cin>>x>>y){
		if(35.50>x&&71.00>y)
		cout<<"AAA"<<endl;
		else if(37.50>x&&77.00>y)
		cout<<"AA"<<endl;
		else if(40.00>x&&83.00>y)
		cout<<"A"<<endl;
		else if(43.00>x&&89.00>y)
		cout<<"B"<<endl;
		else if(50.00>x&&105.00>y)
		cout<<"C"<<endl;
		else if(55.00>x&&116.00>y)
		cout<<"D"<<endl;
		else if(70.00>x&&148.00>y)
		cout<<"E"<<endl;
		else cout<<"NA"<<endl;
		
	}
	return 0;
}