#include<stdio.h>
int main(void)
{
    float masatoy1, masatoy2, koutay1, koutay2, a, b;
    scanf("%f %f", &masatoy1, &koutay1);
    if (masatoy1 <= 35.5&&koutay1 <= 71.0) {
        printf("AAA\n");
    }
    else if (masatoy1 <=37.5&&koutay1 <77.0) {
        printf("AA\n");
    }
    else if (masatoy1 < 40.0&&koutay1 < 83.0) {
        printf("A\n");
    }
    else if (masatoy1 < 43.0&&koutay1 < 89.0) {
        printf("B\n");
    }
    else if (masatoy1 < 50.0&&koutay1 <=105.0) {
        printf("C\n");
    }
    else if (masatoy1 < 55.0&&koutay1 < 116.0) {
        printf("D\n");
    }
    else if (masatoy1 < 70.0&&koutay1 < 148.0) {

        printf("E\n");
    }
    else {
        printf("NA\n");
    }
    return 0;
}