#include <bits/stdc++.h>
#define bug cout << "***************" << endl
#define endl '\n'
#define int long long
#define niuniu cout << "niuniu" << endl;
#define niumei cout << "niumei" << endl;
using namespace std;
constexpr int N = 1e6 + 10, INF = 2e9;
int a[N];
void solve()
{
int a, b;
cin >> a >> b;
int ans = min(a, b) % 3; // 等于0的话后手必胜;
// 但是一开始如果相等,则最小值会改变;
if (ans != 0)
{
if (ans == 1 && a == b) //一直对称下后为1和1,然后轮到niuniu下,niuniu无法下,niumei赢
{
niumei;
return;
}
niuniu;
}
else
{
niumei;
}
}
signed main()
{
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int T = 1;
cin >> T;
while (T--)
{
solve();
}
return 0;
}