http://www.lydsy.com/JudgeOnline/problem.php?id=1457
原来是裸的,又没看出来。。。。
#define _TEST _TEST
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
/************************************************
Code By willinglive Blog:http://willinglive.cf
************************************************/
#define rep(i,l,r) for(int i=(l),___t=(r);i<=___t;i++)
#define per(i,r,l) for(int i=(r),___t=(l);i>=___t;i--)
#define MS(arr,x) memset(arr,x,sizeof(arr))
#define LL long long
#define INE(i,u,e) for(int i=head[u];~i;i=e[i].next)
inline const int read()
{int r=0,k=1;char c=getchar();for(;c<'0'||c>'9';c=getchar())if(c=='-')k=-1;
for(;c>='0'&&c<='9';c=getchar())r=r*10+c-'0';return k*r;}
/
int n;
int sg[110][110];
int vis[1100],c;
/
inline void ins(int x,int y){if(x>0&&y>0&&x!=y)vis[sg[x][y]]=c;}
void get_sg()
{
rep(i,1,99) rep(j,1,99) if(i^j)
{
c++;
rep(k,1,max(i,j))
{
ins(i-k,j);
ins(i,j-k);
ins(i-k,j-k);
}
int t;
for(t=0;vis[t]==c;t++);
sg[i][j]=t;
}
}
bool judge()
{
int x,y,s=0,ok=0;
while(n--)
{
x=read(); y=read();
if(x==0||y==0||x==y) ok=1;
else s^=sg[x][y];
}
return ok||s;
}
/
void solve()
{
get_sg();
rep(i,1,read())
{
n=read();
puts(judge()?"^o^":"T_T");
}
}
/
int main()
{
#ifndef _TEST
freopen("std.in","r",stdin); freopen("std.out","w",stdout);
#endif
solve();
return 0;
}