发布时间: 2017年6月19日 00:24 时间限制: 1000ms 内存限制: 64M

Shitou wants to be the leader of the children while TianTian boasts himself being much braver than Shitou. So they decided to find out who is not only braver but also smarter to be the leader of the children with an interesting game. The game is like this: each time, there are two children playing, there are n candies on the table, two children may take turns to pick the candies, one can pick 1 to m candies in each turn. The one who get the last candy may be the leader. Shitou and Tiantian both want to win the game very much. To show his good manner, Shitou allows TianTian to be the first to pick candies.

The first line of input is the number of test cases. From the second line, there will be several test cases. For each test case, there is one line of input containing n and m(1<=n<=100,1<=m<=100). A line containing 0 follows the last test case.

For each test case, output a line with the name of winner: "Tiantian" or "Shitou".

复制

3 1 2 23 2 4 3

Tiantian Tiantian Shitou