#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
	 float q,p,c=0;
	while(scanf("%f%f",&q,&p) != EOF){
		if(35.50>q&&71.00>p)cout << "AAA"<<endl;
		else if(37.50>q&&77.00>p)cout << "AA"<<endl;
		else if(40.00>q&&83.00>p)cout << 'A'<<endl;
		else if(43.00>q&&89.00>p)cout << 'B'<<endl;
		else if(50.00>q&&105.00>p)cout << 'C'<<endl;
		else if(55.00>q&&116.00>p)cout <<'D'<<endl;
		else if(70.00>q&&148.00>p)cout <<'E'<<endl;
		else cout << "NA" << endl;
	}
	return 0;
}