#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";
		else if(37.50>q&&77.00>p)cout << "AA";
		else if(40.00>q&&83.00>p)cout << 'A';
		else if(43.00>q&&89.00>p)cout << 'B';
		else if(50.00>q&&105.00>p)cout << 'C';
		else if(55.00>q&&116.00>p)cout <<'D';
		else if(70.00>q&&148.00>p)cout <<'E';
		else cout << "NA";
	}
	return 0;
}