#include<bits/stdc++.h>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define ll long long int
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int>pii;
typedef pair<ll,ll>pll;
typedef pair<double,double>pdd;
using namespace std;
#define MAX  999999
int main(){
	double tiya,rize;
	while(cin>>tiya>>rize){
		 if(tiya<35.5&&rize<71)
			cout<<"AAA"<<endl;
		else if(tiya<37.5&&rize<77)
			cout<<"AA"<<endl;
		else if(tiya<40&&rize<83)
			cout<<"A"<<endl;
		else if(tiya<43.0&&rize<89)
			cout<<"B"<<endl;
		else if(tiya<50&&rize<105)
			cout<<"C"<<endl;
		else if(tiya<55&&rize<116)
			cout<<"D"<<endl;
		else if(tiya<70&&rize<148)
			cout<<"E"<<endl;
		else cout<<"NA"<<endl;
	}
}