#include <iostream>

using namespace std;

int main()
{
	double t,ti;

	cin >> t >> ti;

	if(t <= 35.50 && ti <= 71.00)
	{
		cout << "AAA" << endl;
	}
	else if(t <= 37.50 && ti <= 77.00)
	{
		cout << "AA" << endl;
	}
	else if(t <= 40.00 && ti <= 83.00)
	{
		cout << "A" << endl;
	}
	else if(t <= 43.00 && ti <= 89.00)
	{
		cout << "B" << endl;
	}
	else if(t <= 50.00 && ti <= 105.00)
	{
		cout << "C" << endl;
	}
	else if(t <= 55.00 && ti <= 116.00)
	{
		cout << "D" << endl;
	}
	else if(t <= 70 && ti <= 148.00)
	{
		cout << "E" << endl;
	}

	else
		cout << "NA" << endl;

	return 0;
}