#include <iostream>
using namespace std;

int main(void){
	string s[] = {"AAA","AA","A","B","C","D","E","NA"};
	double f[] = {35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0};
	double o[] = {71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0};
	double a,b;

	while(cin>>a>>b){
		int lf,lo;
		for(lf=0;a>=f[lf] && lf<7;lf++);
		for(lo=0;b>=o[lo] && lo<7;lo++);

		int level = max(lf,lo);
		cout<<s[level]<<endl;
	}

	return 0;
}