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

float half[7] = {35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0};
float full[7] = {71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0};
string rank[8] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"};

int main(){
	float t1, t2;
	int i, j;
	
	while(cin >> t1 >> t2){
		
		for(i = 0; i < 7; ++i){
			if(t1 < half[i]) break;
		}
		
		for(j = 0; j < 7; ++j){
			if(t2 < full[j]) break;
		}
		cout << rank[max(i, j)] << endl;
	}
	return 0;
}