#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	string s[8]={"AAA","AA","A","B","C","D","E","NA"};
	double h[8][2]={
	  {35.5,71.0},
	  {37.5,77.0},
	  {40.0,83.0},
	  {43.0,89.0},
	  {50.0,105.0},
	  {55.0,116.0},
	  {70.0,148.0},
	  {1e9,1e9},
	};
	double a,b;
	while(cin>>a>>b){
		rep(i,8)if(h[i][0]>a&&h[i][1]>b){
			cout<<s[i]<<endl;
			break;
		}
	}
}