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

using namespace std;

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef complex<double> Point;

int main()
{
	const char* names[] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"};
	double m500[] = {35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0};
	double m1000[] = {71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0};
	
	double a, b;
	while(scanf("%lf%lf", &a, &b) != EOF){
		puts(names[max(distance(m500, upper_bound(m500, m500+7, a)), distance(m1000, upper_bound(m1000, m1000+7, b)))]);
	}
	
	return 0;
}