Er Ba Game
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Er Ba Game is a popular card game in China's Province Zhejiang.

In this problem, the game involves two players and 36 cards - , each with four.

In the game each player takes 2 cards (a_1,b_1) , (a_2,b_2) .Player  gets (a_i,b_i) . Suppose , and we determine the winner as follow:
  1.  is the biggest pair.
  2. If neither is , a pair with  is greater than a pair without.
  3. If and , then compare a_1,a_2.The bigger one wins.
  4. If , compare .The bigger one wins.
  5. If   and ,compare b_1,b_2.The bigger one wins.

If  does not hold, we can exchange a_1 and b_1 or exchange a_2 and b_2 until the formula holds.

You're told  a_1,b_1,a_2,b_2, and you should tell who's gonna win the game.

输入描述:

The first line contains an integer  — number of game cases.
Then  lines, each contains four integers a_1,b_1, a_2,b_2, denoting the cards of each player.

输出描述:

Output  lines.

If player 1 wins, output "first" (without quote).

If player 2 wins, output "second" (without quote).

Otherwise, output "tie" (without quote).

示例1

输入

复制
5
2 8 4 6
6 6 6 7
4 5 5 5
6 3 9 10
7 2 2 7

输出

复制
first
first
second
second
tie

说明

The answers to the first four sets of data are obtained through the first, second, second, and fifth rules respectively.

备注:

It's guaranteed that .

It's not guaranteed that .