Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	m500 := []float64{35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0, 1000.0}
	m1000 := []float64{71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0, 1000.0}
	classes := []string{"AAA", "AA", "A", "B", "C", "D", "E", "NA"}
	for scanner.Scan() {
		input := strings.Split(scanner.Text(), " ")
		t500, _ := strconv.ParseFloat(input[0], 64)
		t1000, _ := strconv.ParseFloat(input[1], 64)
		for i := 0; i < len(m500); i++ {
			if t500 < m500[i] && t1000 < m1000[i] {
				fmt.Println(classes[i])
				break
			}
		}
	}
}

C++: #include<bits/stdc++.h>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define ll long long int
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define all(in) in.begin(), in.end()
using namespace std;
typedef pair<int, int>pii;
typedef pair<ll,ll>pll;
typedef pair<double,double>pdd;
using namespace std;
#define MAX  999999
int main(){
	double tiya,rize;
	while(cin>>tiya>>rize){
		 if(tiya<35.5&&rize<71)
			cout<<"AAA"<<endl;
		else if(tiya<37.5&&rize<77)
			cout<<"AA"<<endl;
		else if(tiya<40&&rize<83)
			cout<<"A"<<endl;
		else if(tiya<43.0&&rize<89)
			cout<<"B"<<endl;
		else if(tiya<50&&rize<105)
			cout<<"C"<<endl;
		else if(tiya<55&&rize<116)
			cout<<"D"<<endl;
		else if(tiya<70&&rize<148)
			cout<<"E"<<endl;
		else cout<<"NA"<<endl;
	}
}

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

int main(){
	double s,l;
	while(cin>>s>>l){
		if(s<35.5 && l<71)cout<<"AAA";
		else if(s<37.5 && l<60*1+17)cout<<"AA";
		else if(s<40.0 && l<60*1+23)cout<<"A";
		else if(s<43.0 && l<60*1+29)cout<<"B";
		else if(s<50.0 && l<60*1+45)cout<<"C";
		else if(s<55.0 && l<60*1+56)cout<<"D";
		else if(s<70.0 && l<50*2+28)cout<<"E";
		else cout<<"NA";
		cout<<endl;
	}

}

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

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

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

int main()
{
	double t1, t2;
	string s;

	while (cin >> t1 >> t2)
	{
		if (t1 < 35.50 && t2 < 60 + 11) s = "AAA";
		else if (t1 < 37.50 && t2 < 60 + 17) s = "AA";
		else if (t1 < 40.0 && t2 < 60 + 23) s = "A";
		else if (t1 < 43.0 && t2 < 60 + 29) s = "B";
		else if (t1 < 50.0 && t2 < 60 + 45) s = "C";
		else if (t1 < 55.0 && t2 < 60 + 56) s = "D";
		else if (t1 < 60 + 10 && t2 < 60 * 2 + 28) s = "E";
		else s = "NA";

		cout << s << endl;
	}
}

C++: #include <iostream>
#include <string>

using namespace std;

int main(){
	double m[] = {70.0,55.0,50.0,43.0,40.0,37.5,35.5};
	double mm[] = {148.0,116.0,105.0,89.0,83.0,77.0,71.0};
	string award[] = {"NA","E","D","C","B","A","AA","AAA"};
	double t,tt;
	
	while(cin >> t >> tt){
	int g1,g2,min;
	if(m[0] <= t) g1 = -1;
	else {
		for(int i=0;i < 6;i++){
			if(m[i] > t && m[i+1] <= t) g1 = i;
		}
		if(t < m[6]) g1 =6;
	}
	if(mm[0] <= tt) g2 = -1;
	else {
		for(int i=0;i < 6;i++){
			if(mm[i] > tt && mm[i+1] <= tt) g2 = i;
		}
		if(tt < mm[6]) g2 =6;
	}
	if(g1 > g2) min = g2;
	else min = g1;
	cout << award[min+1] << endl;
	}
	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    double time[2];
    while(cin>>time[0]>>time[1]){
        if(time[0]<35.5&&time[1]<71)cout<<"AAA\n";
        else if(time[0]<37.5&&time[1]<77)cout<<"AA\n";
        else if(time[0]<40.0&&time[1]<83)cout<<"A\n";
        else if(time[0]<43.0&&time[1]<89)cout<<"B\n";
        else if(time[0]<50.0&&time[1]<105)cout<<"C\n";
        else if(time[0]<55.0&&time[1]<116)cout<<"D\n";
        else if(time[0]<70&&time[1]<148)cout<<"E\n";
        else cout<<"NA\n";
    }
}

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

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

C++: #include<stdio.h>
int main(void)
{
	float t,t1;
	scanf("%f %f",&t,&t1);
	if(t<35.50 && t1<71.00){
		printf("AAA\n");
	}
	else if(t<37.50 && t1<77.00){
		printf("AA\n");
	}
	else if(t<40.00 && t1<83.00){
		printf("A\n");
	}
	else if(t<43.00 && t1<89.00){
		printf("B\n");
	}
	else if(t<50.00 && t1<95.00){
		printf("C\n");
	}
	else if(t<55.00 && t1<116.00){
		printf("D\n");
	}
	else if(t<70.00 && t1<148.00){
		printf("E\n");
	}
	else{
		printf("NA\n");
	}
	return 0;
}

C++: 
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
typedef pair< pairint , string> P;
int gcd( int x, int y ){ return y ? gcd(y, x%y) : x; }
bool pairCompare(const P& firstElof, const P& secondElof)
{
  if(firstElof.first.first!= secondElof.first.first)    return firstElof.first.first< secondElof.first.first;
else if(firstElof.first.second != secondElof.first.second)    return firstElof.first.second< secondElof.first.second;
else return false;
}
signed main() {
double x=0,y=0,z=0,w=0,n=0,m=0;
int a[4]={0,0,0,0},b[4]={0,0,0,0};
while(std::cin >> x>>y){
if(35.50>x&&71>y)std::cout << "AAA" << '\n';
else if(37.50>x&&77>y)std::cout << "AA" << '\n';
else if(40>x&&83>y)std::cout << "A" << '\n';
else if(43>x&&89>y)std::cout << "B" << '\n';
else if(50>x&&105>y)std::cout << "C" << '\n';
else if(55>x&&116>y)std::cout << "D" << '\n';
else if(70>x&&148>y)std::cout << "E" << '\n';
else std::cout << "NA" << '\n';
}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double t1,t2;
  double gm[7],sm[7];
  string ans[8]={"AAA","AA","A","B","C","D","E","NA"};
  gm[0]=35;gm[1]=37.5;gm[2]=40;gm[3]=43;gm[4]=50;gm[5]=55;gm[6]=70;
  sm[0]=71;sm[1]=77;sm[2]=83;sm[3]=89;sm[4]=105;sm[5]=116;sm[6]=148;
  while(cin>>t1>>t2){
    int i;
    for(i=0;i<7;i++){
      if(gm[i]>t1&&sm[i]>t2)
	break;
    }
    cout<<ans[i]<<endl;
  }
  return 0;
}