#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <bitset>
#define MAX 1000000
using namespace std;
int main(int argc, char *argv[]){
string line, subline;
int t;
cin >> t;
getline(cin, line); while (t--){
getline(cin, line);
int sum=0;
int number=0;
for (int i=0; i<3; ++i){
sum = sum*26+(line[i]-'A');
}
subline = line.substr(4,4);
stringstream ss;
ss << subline;
ss >> number;
if (abs(number-sum)<=100){
puts("nice");
} else {
puts("not nice");
}
}
return 0;
}
沒有留言:
張貼留言