#include <iostream>
using namespace std;

int main(){
	double at,bt;
	while(cin >> at >> bt){
		if(at < 35.50 && bt < 71.00) cout << "AAA" << endl;
		else if(at < 37.50 && bt < 77.00) cout << "AA" << endl;
		else if(at < 40.00 && bt < 83.00) cout << "A" << endl;
		else if(at < 43.00 && bt < 89.00) cout << "B" << endl;
		else if(at < 50.00 && bt < 105.00) cout << "C" << endl;
		else if(at < 55.00 && bt < 116.00) cout << "D" << endl;
		else if(at < 70.00 && bt < 148.00) cout << "E" << endl;
		else cout << "NA" << endl;

	}

	return 0;
}