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

int main(){
  string bg[8]={"AAA","AA","A","B","C","D","E","NA"};
  double m500[7]={35.5,37.5,40.0,43.0,50.0,55.0,70.0};
  double m1000[7]={71.0,77.0,83.0,89.0,105.0,116.0,148.0};
  double a,b;
  while(cin >> a && cin >> b){
    int ans=7;
    for(int i=0;i<7;i++){
      if(a < m500[i] && b < m1000[i]){
	ans = i;
	break;
      }
    }
    cout << bg[ans] << endl;
  }
}