import std.algorithm;
import std.array;
import std.ascii;
import std.bigint;
import std.complex;
import std.container;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

auto readInts() {
	return array(map!(to!int)(readln().strip().split()));
}
auto readInt() {
	return readInts()[0];
}
auto readLongs() {
	return array(map!(to!long)(readln().strip().split()));
}
auto readLong() {
	return readLongs()[0];
}
auto readDoubles() {
	return array(map!(to!double)(readln().strip().split()));
}

void main() {
	while(!stdin.eof()) {
		auto t = readDoubles();
		if(t.length != 2) {
			break;
		}
		if(t[0] < 35.5 && t[1] < 71) {
			writeln("AAA");
			continue;
		}
		if(t[0] < 37.5 && t[1] < 77) {
			writeln("AA");
			continue;
		}
		if(t[0] < 40 && t[1] < 83) {
			writeln("A");
			continue;
		}
		if(t[0] < 43 && t[1] < 89) {
			writeln("B");
			continue;
		}
		if(t[0] < 50 && t[1] < 105) {
			writeln("C");
			continue;
		}
		if(t[0] < 55 && t[1] < 116) {
			writeln("D");
			continue;
		}
		if(t[0] < 70 && t[1] < 148) {
			writeln("E");
			continue;
		}
		writeln("NA");
	}
}