#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

int main() {
	char c[7][4]={"AAA","AA","A","B","C","D","E"};
	double n1,n2,t1[7]={35.5,37.5,40,43,50,55,70},t2[7]={71,77,83,89,105,116,148};
	int i;
	while(cin >> n1 >> n2) {
		for (i=0;i<7;i++) if (n1<t1[i] && n2<t2[i]) break;
		if (i==7) cout << "NA" << endl; else cout << c[i] << endl;
	}
	return 0;
}