//41
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  for(double t,tt;cin>>t>>tt;){
    const char *cls[]={"AAA","AA","A","B","C","D","E","NA"};
    double rt[]={35.5,37.5,40,43,50,55,70};
    double rtt[]={71,77,83,89,105,116,148};
    cout<<cls[max(upper_bound(rt,rt+7,t)-rt,upper_bound(rtt,rtt+7,tt)-rtt)]<<endl;
  }
  return 0;
}