#include <iostream>
using namespace std;

int main()
{

	double time5, time10;

	while( cin >> time5 >> time10 ) {

		if( time5 < 35.5 && time10 < 71.0 ) cout << "AAA";
		else if( time5 < 37.5 && time10 < 67.0 ) cout << "AA";
		else if( time5 < 40.0 && time10 < 83.0 ) cout << "A";
		else if( time5 < 43.0 && time10 < 89.0 ) cout << "B";
		else if( time5 < 50.0 && time10 < 105.0 ) cout << "C";
		else if( time5 < 55.0 && time10 < 116.0 ) cout << "D";
		else if( time5 < 70.0 && time10 < 148.0 ) cout << "E";
		else cout << "NA";

		cout << endl;

	}

	return 0;

}