#include <iostream>

#include <vector>

#include <algorithm>

#include <sstream>

#include <string>

#include <cmath>

#include <list>

using namespace std;



template <typename T> class SegTree

{

public:

	int n;

	T T_max;

	vector<T> dat;

	SegTree(int n_, T t_max)

	{

		int n = 1;

		T_max = t_max;

		while (n < n_)n *= 2;

		for (int i = 0; i < 2 * n - 1; i++)dat.push_back(t_max);

	}

	void update(int k, T a)

	{

		k += n - 1;

		dat[k] = a;

		while (k > 0)

		{

			k = (k - 1) / 2;

			dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);

		}

	}



	//[a,b)

	T query(int a, int b)

	{

		return _query(a, b, 0, 0, n);

	}



private:

	T _query(int a, int b, int k, int l, int r)

	{

		if (r <= a || b <= l)return T_max;

		if (a <= l && r <= b)return dat[k];

		else

		{

			T vl = _query(a, b, k * 2 + 1, l, (l + r) / 2);

			T vr = _query(a, b, k * 2 + 2, (l + r) / 2, r);

			return min(vr, vl);

		}

	}

};

int hoge1(double a)
{
	if (35.50 > a)return 7;
	if (37.50 > a)return 6;
	if (40.00 > a)return 5;
	if (43.00 > a)return 4;
	if (50.00 > a)return 3;
	if (55.00 > a)return 2;
	if (70.00 > a)return 1;
	return 0;
}

int hoge2(double a)
{
	if (71.00 > a)return 7;
	if (77.00 > a)return 6;
	if (83.00 > a)return 5;
	if (89.00 > a)return 4;
	if (105.00 > a)return 3;
	if (116.00 > a)return 2;
	if (148.00 > a)return 1;
	return 0;
}

int main()
{
	double a, b;
	string ans[8] = {"NA", "E", "D", "C", "B", "A", "AA", "AAA"};
	while (cin >> a >> b)
	{
		cout << ans[min(hoge1(a), hoge2(b))] << endl;
	}
}