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