#include <stdio.h>
int main(){
  int t1,t2;
  scanf("%d %d",&t1,&t2);

  if(t1<=35.5&&t2<=71){
    printf("AAA\n");   
  }else if(t1<=37.5&&t2<=77){
    printf("AA\n");
  }else if(t1<=40&&t2<=83){
    printf("A\n");
  }else if(t1<=43&&t2<=89){
    printf("B\n");
  }else if(t1<=50&&t2<=105){
    printf("C\n");
  }else if(t1<=55&&t2<=116){
    printf("D\n");
  }else if(t1<=70&&t2<=148){
    printf("E\n");
  }else{
    printf("NA\n");   
  }
}
  