#include<bits/stdc++.h>
using namespace std;
int main(){
  double t1,t2;
  double gm[7],sm[7];
  string ans[8]={"AAA","AA","A","B","C","D","E","NA"};
  gm[0]=35;gm[1]=37.5;gm[2]=40;gm[3]=43;gm[4]=50;gm[5]=55;gm[6]=70;
  sm[0]=71;sm[1]=77;sm[2]=83;sm[3]=89;sm[4]=105;sm[5]=116;sm[6]=148;
  while(cin>>t1>>t2){
    int i;
    for(i=0;i<7;i++){
      if(gm[i]>t1&&sm[i]>t2)
	break;
    }
    cout<<ans[i]<<endl;
  }
  return 0;
}