#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){

	double a,b;
	while(cin>>a>>b){
		if(a<35.5&&71.0>b){
			cout<<"AAA"<<endl;
		}
		else if(a<37.5&&77.0>b){
			cout<<"AA"<<endl;
		}
		else if(a<40.0&&83.0>b){
			cout<<"A"<<endl;
		}
		else if(a<43.0&&89.0>b){
			cout<<"B"<<endl;
		}
		else if(a<50.0&&105.0>b){
			cout<<"C"<<endl;
		}
		else if(a<55.0&&116.0>b){
			cout<<"D"<<endl;
		}
		else if(a<70.0&&148.0>b){
			cout<<"E"<<endl;
		}
		else
			cout<<"NA"<<endl;
	}

	return 0;
}