#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
double table5[7]={35.50,37.50,40.0,43.0,50.0,55.0,70};
double table1[7]={71.0,77.0,83.0,89.0,105.0,116.0,148.0};
string score[7]={"AAA","AA","A","B","C","D","E"};
int main(){
	double a,b;
	while(cin>>a>>b){
		int t5 = 100;
		int t1 = 100;
		for(int i =0;i < 7;i++){
			if(a<table5[i]){
				t5 = i;
				break;
			}
		}
		for(int j =0;j < 7;j++){
			if(b<table1[j]){
				t1 =j;
				break;
			}
		}
		int ans = max(t1,t5);
		if(ans==100){
			cout <<"NA"<<endl;
		}else{
			cout <<score[ans]<<endl;
		}
	}
	return 0;
}