#include <iostream>
#include <string>
using namespace std;

int main(){
	double inp1,inp2;
	string opt="NA";
	cin >> inp1 >> inp2;
	
	if(inp1<35.5 && inp2<71.0){
		opt = "AAA";
	}else if(inp1<37.5 && inp2<77.0){
		opt = "AA";
	}else if(inp1<40.0 && inp2<83.0){
		opt = "A";
	}else if(inp1<43.0 && inp2<89.0){
		opt = "B";
	}else if(inp1<50.0 && inp2<105.0){
		opt = "C";
	}else if(inp1<55.0 && inp2<116.0){
		opt = "D";
	}else if(inp1<70.0 && inp2<148.0){
		opt = "E";
	}
	cout << opt << endl;
	return 0;
}