#include<iostream>

int main(){

	double a, b;
	while (std::cin >> a >> b){

		if (a < 35.5&&b < 71.0){
			std::cout << "AAA" << std::endl;
		}
		else if (a < 37.5&&b < 77.0){
			std::cout << "AA" << std::endl;
		}
		else if (a < 40.0&&b < 83.0){
			std::cout << "A" << std::endl;
		}
		else if (a < 43.0&&b < 89.0){
			std::cout << "B" << std::endl;
		}
		else if (a < 50.0&&b < 105.0){
			std::cout << "C" << std::endl;
		}
		else if (a < 55.0&&b < 116.0){
			std::cout << "D" << std::endl;
		}
		else if (a < 70.0&&b < 148.0){
			std::cout << "E" << std::endl;
		}
		else std::cout << "NA" << std::endl;
	}

	return 0;
}