#include<iostream>
using namespace std;
int main(){
long i,j;
double a,b,aa[7]={35.5,37.5,40,43,50,55,70},bb[7]={71,77,83,89,105,116,148};
while(cin>>a>>b){
for(i=0;i<7;i++)if(a<aa[i])break;j=i;
for(i=j;i<7;i++)if(b<bb[i])break;
if(i==0)cout<<"AA";
if(i==1)cout<<"A";
cout<<"AAABCDEN"[i];
if(i==7)cout<<"A";
cout<<endl;
}
return 0;
}