#include <iostream>
using namespace std;

int main(void){
	double x,y;

	while(cin>>x>>y){
		if(x < 35.5 && y < 71){
			cout<<"AAA\n";
		}
		else if(x < 37.5 && y < 77){
			cout<<"AA\n";
		}
		else if(x < 40 && y < 83){
			cout<<"A\n";
		}
		else if(x < 43 && y < 89){
			cout<<"B\n";
		}
		else if(x < 50 && y < 105){
			cout<<"C\n";
		}
		else if(x < 55 && y < 116){
			cout<<"D\n";
		}
		else if(x < 70 && y < 148){
			cout<<"E\n";
		}
		else{
			cout<<"NA\n";
		}
	}

	return 0;
}