# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);

int main() {
	double t1, t2;
	while (cin >> t1 >> t2) {
		int a1, a2;
		if (t1 < 35.5)a1 = 1;
		else if (t1 < 37.5)a1 = 2;
		else if (t1 < 40.0)a1 = 3;
		else if (t1 < 43.0)a1 = 4;
		else if (t1 < 50.0)a1 = 5;
		else if (t1 < 55.0)a1 = 6;
		else if (t1 < 70.0)a1 = 7;
		else a1 = 8;

		if (t2 < 71)a2 = 1;
		else if (t2 < 77)a2 = 2;
		else if (t2 < 83)a2 = 3;
		else if (t2 < 89)a2 = 4;
		else if (t2 < 105)a2 = 5;
		else if (t2 < 116)a2 = 6;
		else if (t2 < 148)a2 = 7;
		else a2 = 8;
		string ans[9] = { " ","AAA","AA","A","B","C","D","E","NA" };
		cout << ans[max(a1, a2)] << endl;
	}
}