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

int main(){
	double tim1[] = {35.5,37.5,40.0,43.0,50.0,55.0,70.0},tim2[] = {71.0,77.0,83.0,89.0,105.0,116.0,148.0};
	string rnk[] = {"AAA","AA","A","B","C","D","E"};
	double t1,t2;
	while(cin >> t1 >> t2){
		int i = 0;
		for(;i < 7;i++){
			if(t1 < tim1[i] && t2 < tim2[i]) break;
		}
		if(i == 7) cout << "NA" << endl;
		else cout << rnk[i] << endl;
	}
	return 0;
}