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<iostream>
#include<string>
using namespace std;

int main()
{
    double time1,time2;
    while(cin>>time1>>time2)
    {
        if(time1<35.5&&time2 <71){cout<<"AAA"<<endl;continue;}
        if(time1<37.5&&time2 <77){cout<<"AA"<<endl;continue;}
        if(time1<40&&time2 <83){cout<<"A"<<endl;continue;}
        if(time1<43&&time2 <89){cout<<"B"<<endl;continue;}
        if(time1<50&&time2 <105){cout<<"C"<<endl;continue;}
        if(time1<55&&time2 <116){cout<<"D"<<endl;continue;}
        if(time1<70&&time2 <148){cout<<"E"<<endl;continue;}
        cout <<"NA"<<endl;
    }
    return 0;
}

C++: #include<iostream>

using namespace std;

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

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

C++: #include <stdio.h>
int main()
{
	float n500,n1000;
	while(scanf("%f %f",&n500,&n1000)!=EOF){
		if(n500<35.5&&n1000<71)
			printf("AAA\n");
		else if(n500<37.5&&n1000<77)
			printf("AA\n");
		else if(n500<40&&n1000<83)
			printf("A\n");
		else if(n500<43&&n1000<89)
			printf("B\n");
		else if(n500<50&&n1000<105)
			printf("C\n");
		else if(n500<55&&n1000<116)
			printf("D\n");
		else if(n500<70.002&&n1000<148)
			printf("E\n");
		else
			printf("NA");
	}
}

C++: #include <iostream>

using namespace std;

int main() {

	double ms, ml;
	double s[7]={35.50, 37.50, 40.00, 43.00, 50.00, 55.00, 70.00};
	double l[7]={71.00, 77.00, 83.00, 89.00, 105.00, 116.00, 148.00};
	char r[8][4]={"AAA", "AA", "A", "B", "C", "D", "E", "NA"};

	while(cin >> ms >> ml) {
		int ss=7, ll=7;
		for(int i=6; i>=0; i--) {
			if(ms<s[i]) {
				ss=i;
			}
		}
		for(int i=6; i>=0; i--) {
			if(ml<l[i]) {
				ll=i;
			}
		}

		if(ss<ll) {
			ss=ll;
		}

		cout << r[ss] << endl;
	}
	
	return 0;

}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <bitset>
#include <complex>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl;
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef complex<double> CD;

int main() {
	double t1, t2;
	VS s = { "AAA","AA","A","B","C","D","E" ,"NA" };
	while (cin >> t1 >> t2) {
		int ty;
		if (t1 < 35.50&&t2 < 71.00)ty = 0;
		else if (t1 < 37.50&&t2 < 77.00)ty = 1;
		else if (t1 < 40.00&&t2 < 83.00)ty = 2;
		else if (t1 < 43.00&&t2 < 89.00)ty = 3;
		else if (t1 < 50.00&&t2 < 105.00)ty = 4;
		else if (t1 < 55.00&&t2 < 116.00)ty = 5;
		else if (t1 < 70.00&&t2 < 148.00)ty = 6;
		else ty = 7;

		Cout(s[ty]);
	}
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    double a, b;
    int l, r;
    while(cin >> a >> b){
        if(a < 35.50){
            l = 1;
        }else if(a < 37.50){
            l = 2;
        }else if(a < 40.00){
            l = 3;
        }else if(a < 43.00){
            l = 4;
        }else if(a < 50.00){
            l = 5;
        }else if(a < 55.00){
            l = 6;
        }else if(a < 70.00){
            l = 7;
        }else{
            l = 8;
        }
        if(b < 71.00){
            r = 1;
        }else if(b < 77.00){
            r = 2;
        }else if(b < 83.00){
            r = 3;
        }else if(b < 89.00){
            r = 4;
        }else if(b < 105.00){
            r = 5;
        }else if(b < 116.00){
            r = 6;
        }else if(b < 148.00){
            r = 7;
        }else{
            r = 8;
        }
        int ans = max(l,r);
        if(ans == 1)
            cout << "AAA" << endl;
        if(ans == 2)
            cout << "AA" << endl;
        if(ans == 3)
            cout << "A" << endl;
        if(ans == 4)
            cout << "B" << endl;
        if(ans == 5)
            cout << "C" << endl;
        if(ans == 6)
            cout << "D" << endl;
        if(ans == 7)
            cout << "E" << endl;
        if(ans == 8)
            cout << "NA" << endl;
    }
}

C++: #include<stdio.h>
int main(void)
{
	float a,b;
	while(scanf("%f %f",&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");
		}
	//	scanf("%d %d",&a,&b);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	float a,b;
	while(scanf("%f %f",&a,&b)!=EOF){
	if(a<35.5 && b<71.0){
			printf("AAA\n");
			}
	else if(a<37.5 && b<77.0){
			printf("AA\n");
			}
	else if(a<40.0 && b<83.0){
			printf("A\n");
			}
	else if(a<43.0 && b<89.0){
			printf("B\n");
			}
	else if(a<50.0 && b<105.0){
			printf("c\n");
			}
	else if(a<55.0 && b<116.0){
			printf("D\n");
			}
	else if(a<70.0 && b<148.0){
			printf("E\n");
			}
		else{
			printf("NA\n");
		}
		}
	return 0;
}