#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
const int MAXN = 1e6 + 6;
int a[MAXN];
int main()
{
int T;
cin >> T;
while (T--)
{
int s, n, m, pos = 0;
cin >> s >> n >> m;
while (n != m)
{
if (n > m)
{
m++;
a[pos++] = 1;
}
else
{
if (m % 2 == 1)
{
m++;
a[pos++] = 1;
}
else
{
m /= 2;
a[pos++] = 2;
}
}
}
if (pos <= s)
{
for (int i = pos-1; i >= 0; i--)
{
if (a[i] == 1)
cout << "yeah! ";
else
cout << "oh! ";
}
cout << endl;
}
else
cout << "OMG!" << endl;
}
return 0;
}