#include<iostream>
using namespace std;
int main(){
  double a,b;
  while(cin>>a>>b){
    if(35.5>a && 71.0>b){
      cout<<"AAA"<<endl;
    }else if(37.5>a && 77>b){
      cout<<"AA"<<endl;
    }else if(40>a && 83>b){
      cout<<"A"<<endl;
    }else if(43>a && 89>b){
      cout<<"B"<<endl;
    }else if(50>a && 95>b){
      cout<<"C"<<endl;
    }else if(55>a && 77>b){
      cout<<"D"<<endl;
    }else if(70>a && 148>b){
      cout<<"E"<<endl;
    }else{
      cout<<"NA"<<endl;
    }
  }
}
    