#include<iostream>
#include<vector>
#include<string>
using namespace std;

int main()
{
	int i;
	double a, b;
	vector< vector<double> > Time(7, vector<double>(2));
	Time[0][0] = 35.50; Time[0][1] = 71.00;
	Time[1][0] = 37.50; Time[1][1] = 77.00;
	Time[2][0] = 40.00; Time[2][1] = 83.00;
	Time[3][0] = 43.00; Time[3][1] = 89.00;
	Time[4][0] = 50.00; Time[4][1] = 105.00;
	Time[5][0] = 55.00; Time[5][1] = 116.00;
	Time[6][0] = 70.00; Time[6][1] = 148.00;
	vector<string> Class(8);
	Class[0] = "AAA";
	Class[1] = "AA";
	Class[2] = "A";
	Class[3] = "B";
	Class[4] = "C";
	Class[5] = "D";
	Class[6] = "E";
	Class[7] = "NA";
	while (cin>>a>>b) {
		for (i = 0; i < 7; i++)
			if (a<Time[i][0] && b<Time[i][1]) break;
		cout<<Class[i]<<endl;
	}
	return 0;
}