Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	badge := []string{"AAA", "AA", "A", "B", "C", "D", "E"}
	badgeLen := len(badge)
	short := []float64{35.5, 37.5, 40, 43, 50, 55, 70}
	long := []float64{71, 77, 83, 89, 105, 116, 148}

	stdin := bufio.NewScanner(os.Stdin)
	for stdin.Scan() {
		time := strings.Split(stdin.Text(), " ")

		sT, _ := strconv.ParseFloat(time[0], 64)
		lT, _ := strconv.ParseFloat(time[1], 64)

		sR, lR, t := 0, 0, 0.0
		for _, t = range short {
			if sT < t {
				break
			}
			sR++
		}
		for _, t = range long {
			if lT < t {
				break
			}
			lR++
		}
		rank := ""
		if sR >= badgeLen || lR >= badgeLen {
			rank = "NA"
		} else if sR >= lR {
			rank = badge[sR]
		} else {
			rank = badge[lR]
		}
		fmt.Println(rank)
	}
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
#define INF 114514
using namespace std;




int main()
{
	double fh, om;
	while (cin>>fh>>om) {
		if (fh < 35.5 && om < 71.0) {
			puts("AAA");
		}
		else if (fh < 37.5 && om < 77.0) {
			puts("AA");
		}
		else if (fh < 40.0 && om < 83.0) {
			puts("A");
		}
		else if (fh < 43.0 && om < 89.0) {
			puts("B");
		}
		else if (fh < 50.0 && om < 105.0) {
			puts("C");
		}
		else if (fh < 55.0 && om < 116.0) {
			puts("D");
		}
		else if (fh < 70.0 && om < 148.0) {
			puts("E");
		}
		else {
			puts("NA");
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

char rank[8][4] = {"AAA", "AA", "A", "B", "C", "D", "E", "NA"};
double aa[7] = {35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0};
double bb[7] = {71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0};

int main()
{
    double a,b;
    while(cin >> a >> b){
        for(int i=0;i<8;i++){
            if(i==7){
                cout << rank[i] << endl;
                break;
            }
            if(a < aa[i] && b < bb[i]){
                cout << rank[i] << endl;
                break;
            }
        }
    }
    return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
while(1){
double a,b;
cin>>a;
if (cin.fail()) break;
cin>>b;
if(a<35.5&&b<71){cout<<"AAA"<<endl;}
else if(a<37.5&&b<77){cout<<"AA"<<endl;}
else if(a<40&&b<83){cout<<"A"<<endl;}
else if(a<43&&b<89){cout<<"B"<<endl;}
else if(a<50&&b<105){cout<<"C"<<endl;}
else if(a<55&&b<116){cout<<"D"<<endl;}
else if(a<70&&b<148){cout<<"E"<<endl;}
else{cout<<"NA"<<endl;}

}
}

C++: #include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main() {
  for(double s, g;cin >> s >> g;) {
    string out;
    if(s < 35.50 && g < 71.00) out = "AAA";
    else if(s < 37.0 && g < 77.00) out = "AA";
    else if(s < 40.0 && g < 83.00) out = "A";
    else if(s < 43.0 && g < 89.00) out = "B";
    else if(s < 50.0 && g < 105.00) out = "C";
    else if(s < 55.0 && g < 116.00) out = "D";
    else if(s < 70.0 && g < 148.00) out = "E";
    else out = "NA";
    cout << out << endl;
  }
  return 0;
}

C++: #include<stdio.h>
int main(void)
{
	double a,s;
	while(scanf("%lf %lf",&a,&s)!=EOF){
		if(a<35.50&&s<71.00){
			printf("AAA\n");
		}
		else if(a<37.50&&s<77.00){
			printf("AA\n");
		}
		else if(a<40.00&&s<83.00){
			printf("A\n");
		}
		else if(a<43.00&&s<89.00){
			printf("B\n");
		}
		else if(a<50.00&&s<105.00){
			printf("C\n");
		}
		else if(a<55.00&&s<116.00){
			printf("D\n");
		}
		else if(a<70.00&&s<148.00){
			printf("E\n");
		}
		else{
			printf("NA\n");
		}
		}
	return 0;
}

C++: #include<iostream>
using namespace std;


int main(){
	double tl500[]= {70,  55, 50, 43, 40, 37.5,  35.5};
	double tl1000[]={148,116,105, 89, 83, 77, 71};
	char *rank[]=    {"E","D","C","B","A","AA","AAA"};
	
	double a,b;
	while(cin>>a>>b){
		char *ans="NA";
		for(int i=0;i<7;i++){
			if(a<tl500[i]&&b<tl1000[i])ans=rank[i];
		}
		cout<<ans<<endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	double a,b;
	cin>>a>>b;
	if(a<35.5&&b<71.0){
		cout<<"AAA"<<endl;
	}else if(a<37.5&&b<77.0){
		cout<<"AA"<<endl;
	}else if(a<40.0&&b<83.0){
		cout<<"A"<<endl;
	}else if(a<43.0&&b<89.0){
		cout<<"B"<<endl;
	}else if(a<50.0&&b<105.0){
		cout<<"C"<<endl;
	}else if(a<55.0&&b<116.0){
		cout<<"D"<<endl;
	}else if(a<70.0&&b<88.0){
		cout<<"E"<<endl;
	}else{
		cout<<"NA"<<endl;
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	double a,b;
	while(cin>>a>>b){
		string z="NA";
		if(a<70&&b<148)
			z="E";
		if(a<55&&b<116)
			z="D";
		if(a<50&&b<105)
			z="C";
		if(a<43&&b<89)
			z="B";
		if(a<40&&b<83)
			z="A";
		if(a<37&&b<77)
			z="AA";
		if(a<35&&b<71)
			z="AAA";
		cout<<z<<endl;
	}
    return 0;
}

C++: #include<stdio.h>
int main(main)
{
	double a,b;
	while(scanf("%lf %lf",&a,&b)!=EOF){
		if(a<=35.5 && b<=71){
			printf("AAA\n");
		}
		else if(a<37.5 && b<77){
			printf("AA\n");
		}
		else if(a<40 && b<83){
			printf("A\n");
		}
		else if(a<43 && b<89){
			printf("B\n");
		}
		else if(a<50 && b<105){
			printf("c\n");
		}
		else if(a<55 && b<116){
			printf("D\n");
		}
		else if(a<60 && b<148){
			printf("E\n");
		}
		else{
			printf("NA\n");
		}
	//	scanf("%d %d",&a,&b);
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <stack>

using namespace std;

int main(){
	
	double a, b;
	
	cin >> a;
	
	while(true){
		if(cin.eof()){
			break;
		}
		cin >> b;
		
		if(a < 35.5 && b < 71){
			printf("AAA\n");
		}else if(a < 37.5 && b < 77){
			printf("AA\n");
		}else if(a < 40 && b < 83){
			printf("A\n");
		}else if(a < 43 && b < 89){
			printf("B\n");
		}else if(a < 50 && b < 105){
			printf("C\n");
		}else if(a < 55 && b < 116){
			printf("D\n");
		}else if(a < 70 && b < 148){
			printf("E\n");
		}else{
			printf("NA\n");
		}
		
		cin >> a;
	}
	
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){

	double a,b;

	while(cin>>a>>b){
		if(a<35.50&&b<71.0) cout<<"AAA"<<endl;
		else if(a<37.50&&b<77.0) cout<<"AA"<<endl;
		else if(a<40.0&&b<83.0) cout<<"A"<<endl;
		else if(a<43.0&&b<89.0) cout<<"B"<<endl;
		else if(a<50.0&&b<105.0) cout<<"C"<<endl;
		else if(a<55.0&&b<116.0) cout<<"D"<<endl;
		else if(a<70.0&&b<148.0) cout<<"E"<<endl;
		else cout<<"NA"<<endl;
	}

}

C++: #include <stdio.h>

int main(void){
	double a, b;
	while(scanf("%lf%lf",&a,&b) != EOF){
	if(a < 35.5 && b < 71)
		printf("AAA\n");
	else if(a < 37.5 && b < 77)
		printf("AA\n");
	else if(a < 40 && b < 83)
		printf("A\n");
	else if(a < 43 && b < 89)
		printf("B\n");
	else if(a < 50 && b < 105)
		printf("C\n");
	else if(a < 55 && b < 116)
		printf("D\n");
	else if(a < 70 && b < 148)
		printf("E\n");
	else
		printf("NA\n");
	}
	return 0;
}

C++: #include<cstdio>
#include<string>
main(){
	using namespace std;
	string lv[8] = {"AAA","AA","A","B","C","D","E","NA"};
	double ind1,ind2,lvd5[7] = {35.5,37.5,40.0,43.0,50.0,55.0,70.0};
	int i,j,lvd1[7] = {71,77,83,89,105,116,148};
	while(~scanf("%lf %lf",&ind1,&ind2)){
		i = j = 0;
		while(i++<7)
		  if(ind1 < lvd5[i])
		    break;
		while(j++<7)
		  if(ind2 < lvd1[j])
		    break;
		printf("%s\n", i <= j ? lv[j].c_str() : lv[i].c_str());
	}
	return 0;
}