#define _USE_MATH_DEFINES
#include <iostream>
#include <complex>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <math.h>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <map>
#include <cassert>
#include <time.h>

using namespace std;

typedef complex<double> xy_t;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int , P> PP;
typedef pair<int, string> Ps;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF= 1 << 30;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;

#define rep(i, n) for(int i = 0; i < n; i++)

int main(){
	double a, b;
	while(cin >> a >> b){
		if(a < 35.50 && b < 71.0){
			cout << "AAA" << endl;
		}else if(a < 37.50 && b < 77.00){
			cout << "AA" << endl;
		}else if(a < 40.00 && b < 83.00){
			cout << "A" << endl;
		}else if(a < 43.00 && b < 89.00){
			cout << "B" << endl;
		}else if(a < 50.00 && b < 105.00){
			cout << "C" << endl;
		}else if(a < 55.00 && b < 116.0){
			cout << "D" << endl;
		}else if(a < 70.0 && b < 148.0){
			cout << "E" << endl;
		}else {
			cout << "NA" << endl;
		}
	}
	return 0;
}
	