#include<iostream>
#include<algorithm>
using namespace std;

int main(){
	float n, m;
	while(cin >> n >> m){
		if(n < 35.5 && m < 71.0) cout << "AAA" << endl;
		else if(n < 37.5 && m < 77.0) cout << "AA" << endl;
		else if(n < 40.0 && m < 83.0) cout << "A" << endl;
		else if(n < 43.0 && m < 89.0) cout << "B" << endl;
		else if(n < 50.0 && m < 105.0) cout << "C" << endl;
		else if(n < 55.0 && m < 116.0) cout << "D" << endl;
		else if(n < 70.0 && m < 148.0) cout << "E" << endl;
		else cout << "NA" << endl;
	}
}