#include <iostream>
using namespace std;

int main(){
	double fif,one;
	while(cin >> fif >> one){
		puts(	fif<35.5&&one<71.0 ? "AAA":
				fif<37.5&&one<77.0 ? "AA":
				fif<40.0&&one<83.0 ? "A":
				fif<43.0&&one<89.0 ? "B":
				fif<50.0&&one<105.0 ? "C":
				fif<55.0&&one<116.0 ? "D":
				fif<70.0&&one<148.0 ? "E":
				"NA"
		);
	}
}