Kyle and Mike are bored on a rainy day and decide to pass the time by creating a new game having the following rules:

The game starts with two $n$-sized integer arrays, $\mbox{A}$ and $\mbox{B}$, and is played by two players, $\mathbf{P_1}$ and $P_2$. 
The players move in alternating turns, with $\mathbf{P_1}$ always moving first. During each move, the current player must choose an integer, $\boldsymbol{i}$, such that $0\leq i\leq n-1$. If the current player is $\mathbf{P_1}$, then $\mathbf{P_1}$ receives $A_i$ points; if the current player is $P_2$, then $P_2$ receives $B_i$ points.
Each value of $\boldsymbol{i}$ can be chosen only once. That is, if a value of $\boldsymbol{i}$ is already chosen by some player, none of the player can re-use it. So, game always ends after $n$ moves.
The player with the maximum number of points wins.
The arrays A and B are accessible to both the players P1 and P2. So the players make a optimal move at every turn. 

Given the values of $n$, $\mbox{A}$, and $\mbox{B}$, can you determine the outcome of the game? Print $\textbf{First}$ if $\mathbf{P_1}$ will win, $\textbf{Second}$ if $P_2$ will win, or $\textbf{Tie}$ if they will tie. Assume both players always move optimally.

Input Format

The first line of input contains a single integer, $\mathbf{T}$, denoting the number of test cases. Each of the $3T$ subsequent lines describes a test case. A single test case is defined over the following three lines:

An integer, $n$, denoting the number of elements in arrays $\mbox{A}$ and $\mbox{B}$.
$n$ space-separated integers, $A_0,A_1,\ldots,A_{n-1}$, where each $A_i$ describes the element at index $\boldsymbol{i}$ of array $\mbox{A}$.
$n$ space-separated integers, $B_{0},B_{1},...,B_{n-1}$, where each $B_i$ describes the element at index $\boldsymbol{i}$ of array $\mbox{B}$.

Constraints

$1\leq T\leq10$ 
$1\leq n\leq1000$ 
$1\leq A_i,B_i\leq10^5$ 

Output Format

For each test case, print one of the following predicted outcomes of the game on a new line:

Print $\textbf{First}$ if $\mathbf{P_1}$ will win.
Print $\textbf{Second}$ if $P_2$ will win.
Print $\textbf{Tie}$ if the two players will tie.

Sample Input
3
3
1 3 4
5 3 1
2
1 1
1 1
2
2 2
3 3

Sample Output
First
Tie
Second

Explanation

Test Case 0: $A=\{1,3,4\}$, $B=\{5,3,1\}$
The players make the following $n$ moves:

$\mathbf{P_1}$ chooses $i=2$ and receives $4$ points.
$P_2$ chooses $i=\textbf{0}$ and receives $5$ points. Note that $P_2$ will not choose $i=1$, because this would cause $\mathbf{P_1}$ to win.
$\mathbf{P_1}$ chooses $i=1$ (which is the only remaining move) and receives $3$ points.

As all $n=3$ moves have been made, the game ends. $\mathbf{P_1}$'s score is $7$ points and $P_2$'s score is $5$ points, so $\mathbf{P_1}$ is the winner and we print $\textbf{First}$ on a new line.

Test Case 1: $A=\{1,1\}$, $B=\{1,1\}$
Because both players will only make $1$ move and all possible point values are $1$, the players will end the game with equal scores. Thus, we print $\textbf{Tie}$ on a new line.

Test Case 1: $A=\{2,2\}$, $B=\{3,3\}$ 

Because both players will only make $1$ move and all the possible point values for $P_2$ are greater than all the possible point values for $\mathbf{P_1}$, $P_2$ will win the game. Thus, we print $\textbf{Second}$ on a new line.

Source: hackerrank | Difficulty: MEDIUM
Tags: Game theory


Solutions:
for i in range(int(input())):
	(n, a) = (int(input()), [list(map(int, input().split())) for j in [0, 1]])
	s = [a[0][j] + a[1][j] for j in range(n)]
	x = c = 0
	for j in range(n):
		k = s.index(max(s))
		if c == 0:
			x += a[0][k]
		if c == 1:
			x -= a[1][k]
		s.pop(k)
		a[0].pop(k)
		a[1].pop(k)
		c = 1 - c
	if x > 0:
		print('First')
	elif x < 0:
		print('Second')
	else:
		print('Tie')


T = int(input().strip())
for _ in range(T):
	n = int(input().strip())
	A = input().strip().split(' ')
	A = [int(r) for r in A]
	B = input().strip().split(' ')
	B = [int(r) for r in B]
	totalA = 0
	totalB = 0
	index = 0
	turn = False
	theValue = [A[r] + B[r] for r in range(n)]
	for Z in range(n):
		turn = not turn
		if turn:
			a = max(theValue)
			index = theValue.index(a)
			theValue.pop(index)
			amount = A[index]
			A.pop(index)
			B.pop(index)
			totalA += amount
		else:
			a = max(theValue)
			index = theValue.index(a)
			theValue.pop(index)
			A.pop(index)
			amount = B[index]
			B.pop(index)
			totalB += amount
	if totalA == totalB:
		print('Tie')
	if totalA > totalB:
		print('First')
	if totalA < totalB:
		print('Second')


import sys
tcase = int(input().strip())
for i in range(tcase):
	l = int(input().strip())
	a = [int(el) for el in input().strip().split(' ')]
	b = [int(el) for el in input().strip().split(' ')]
	s = [a[x] + b[x] for x in range(l)]
	suma = sumb = 0
	j = 0
	while a:
		index = s.index(max(s))
		suma += a[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		if not a:
			break
		index = s.index(max(s))
		sumb += b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
	if suma > sumb:
		print('First')
	elif sumb > suma:
		print('Second')
	else:
		print('Tie')


x = int(input())
while x > 0:
	n = int(input())
	a = [int(n) for n in input().split()]
	b = [int(n) for n in input().split()]
	m = [a[i] + b[i] for i in range(n)]
	result = 0
	player = 0
	while n > 0:
		index = m.index(max(m))
		if player == 0:
			result = result + a[index]
		if player == 1:
			result = result - b[index]
		a.pop(index)
		b.pop(index)
		m.pop(index)
		player = 1 - player
		n = n - 1
	if result > 0:
		print('First')
	elif result < 0:
		print('Second')
	else:
		print('Tie')
	x = x - 1


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = [(i + j, i, j) for (i, j) in zip(a, b)]
	c.sort(reverse=True)
	first = sum((c[i][1] for i in range(0, n, 2)))
	second = sum((c[i][2] for i in range(1, n, 2)))
	if first == second:
		print('Tie')
	if first < second:
		print('Second')
	if second < first:
		print('First')


for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	s = [a[i] + b[i] for i in range(n)]
	(asum, bsum) = (0, 0)
	p = 0
	for i in range(n):
		index = s.index(max(s))
		if p == 0:
			asum += a[index]
		if p == 1:
			bsum += b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		p = 1 - p
	if asum > bsum:
		print('First')
	elif asum == bsum:
		print('Tie')
	else:
		print('Second')


for _ in range(int(input())):
	_ = input()
	a = [int(x) for x in input().split(' ')]
	b = [int(x) for x in input().split(' ')]
	order = sorted(((j, i) for (i, j) in enumerate([x + y for (x, y) in zip(a, b)])))[::-1]
	(suma, sumb) = (0, 0)
	turn = 0
	for (_, i) in order:
		suma += (1 - turn) * a[i]
		sumb += turn * b[i]
		turn = 1 - turn
	if suma > sumb:
		print('First')
	elif sumb > suma:
		print('Second')
	else:
		print('Tie')


class piece:
	val1 = 0
	val2 = 0

	def __init__(self, v1, v2):
		self.val1 = v1
		self.val2 = v2
for T in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	l = []
	for i in range(n):
		p = piece(l1[i], l2[i])
		l.append(p)
	ans1 = 0
	ans2 = 0
	l.sort(key=lambda x: x.val1 + x.val2, reverse=True)
	for i in range(len(l)):
		if i % 2 is 0:
			ans1 += l[i].val1
		else:
			ans2 += l[i].val2
	if ans1 > ans2:
		print('First')
	elif ans1 == ans2:
		print('Tie')
	else:
		print('Second')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = [i + j for (i, j) in zip(a, b)]
	d = range(n)
	(c, d) = zip(*sorted(zip(c, d)))
	sa = sb = 0
	for i in range(n - 1, -1, -2):
		sa += a[d[i]]
		if i - 1 >= 0:
			sb += b[d[i - 1]]
	if sa == sb:
		print('Tie')
	elif sa > sb:
		print('First')
	else:
		print('Second')


cases = int(input())

def add_indices(l_1, l_2):
	s = []
	for i in range(n):
		s.append(l_1[i] + l_2[i])
	return s
for g in range(cases):
	n = int(input())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	first = True
	sums = add_indices(a, b)
	(p_1, p_2) = (0, 0)
	while sums:
		ind = sums.index(max(sums))
		if first:
			p_1 += a[ind]
		else:
			p_2 += b[ind]
		first = not first
		a.pop(ind)
		b.pop(ind)
		sums.pop(ind)
	if p_1 > p_2:
		print('First')
	elif p_1 == p_2:
		print('Tie')
	else:
		print('Second')


from math import ceil
for kappa in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	c = [0] * n
	score = 0
	for i in range(n):
		c[i] = -a[i] - b[i]
	d = sorted(zip(c, a, b))
	a = [x[1] for x in d]
	b = [x[2] for x in d]
	score = 0
	player = 0
	for i in range(n):
		if player == 0:
			score += a[i]
		else:
			score -= b[i]
		player = (player + 1) % 2
	if score > 0:
		print('First')
	elif score < 0:
		print('Second')
	elif score == 0:
		print('Tie ')


T = int(input().strip())
for t in range(T):
	N = int(input().strip())
	A = [int(a) for a in input().strip().split(' ')]
	B = [int(b) for b in input().strip().split(' ')]
	s = [A[x] + B[x] for x in range(N)]
	add = c = 0
	for i in range(N):
		index = s.index(max(s))
		if c == 0:
			add += A[index]
		if c == 1:
			add -= B[index]
		s.pop(index)
		A.pop(index)
		B.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')


import sys
n = int(input().strip())
for i in range(0, n):
	x = int(input().strip())
	p = [int(arr_temp) for arr_temp in input().strip().split(' ')]
	q = [int(arr_temp) for arr_temp in input().strip().split(' ')]
	s = [p + q for (p, q) in zip(p, q)]
	re = [i[0] for i in sorted(enumerate(s), key=lambda x: x[1], reverse=True)]
	ps = [p[i] for i in re[::2]]
	qs = [q[i] for i in re[1::2]]
	sp = sum(ps)
	sq = sum(qs)
	if sp > sq:
		print('First')
	if sq > sp:
		print('Second')
	if sp == sq:
		print('Tie')


T = int(input().strip())
for c in range(T):
	n = int(input())
	A = [[int(c) for c in input().strip().split()], [int(c) for c in input().strip().split()]]
	S = []
	for (c, d) in zip(A[0], A[1]):
		S.append(c + d)
	p = [0, 0]
	t = 0
	while S:
		idx = S.index(max(S))
		p[t] += A[t][idx]
		S.pop(idx)
		A[0].pop(idx)
		A[1].pop(idx)
		t = (t + 1) % 2
	if p[0] > p[1]:
		print('First')
	elif p[1] > p[0]:
		print('Second')
	else:
		print('Tie')


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	s = [x + y for (x, y) in zip(a, b)]
	s.sort(reverse=True)
	val2 = 0
	for i in range(1, n, 2):
		val2 += s[i]
	val1 = sum(a)
	if val1 > val2:
		print('First')
	elif val1 < val2:
		print('Second')
	else:
		print('Tie')


for _ in range(int(input())):
	input()
	a = map(int, input().split())
	b = map(int, input().split())
	a = list(map(lambda x, y: (x, y), a, b))
	a.sort(key=sum, reverse=True)
	d = x = 0
	for i in a:
		d += -i[1] if x else i[0]
		x ^= 1
	print('First' if d > 0 else 'Second' if d < 0 else 'Tie')


T = int(input().strip())
for num_case in range(T):
	n = int(input().strip())
	A = list(map(int, input().strip().split(' ')))
	B = list(map(int, input().strip().split(' ')))
	sumAB = [A[i] + B[i] for i in range(n)]
	P1_pts = 0
	P2_pts = 0
	for j in range(n):
		pos = sumAB.index(max(sumAB))
		if j % 2 == 0:
			P1_pts += A[pos]
		else:
			P2_pts += B[pos]
		sumAB.pop(pos)
		A.pop(pos)
		B.pop(pos)
	if P1_pts > P2_pts:
		print('First')
	elif P1_pts == P2_pts:
		print('Tie')
	else:
		print('Second')


t = int(input())
for testcase in range(t):
	n = int(input())
	A = [int(c_temp) for c_temp in input().strip().split(' ')]
	B = [int(c_temp) for c_temp in input().strip().split(' ')]
	S = [A[x] + B[x] for x in range(n)]
	answer = 0
	temp = 0
	for i in range(n):
		index = S.index(max(S))
		if temp == 0:
			answer += A[index]
		if temp == 1:
			answer -= B[index]
		S.pop(index)
		A.pop(index)
		B.pop(index)
		temp = 1 - temp
	if answer > 0:
		print('First')
	elif answer < 0:
		print('Second')
	else:
		print('Tie')


N = int(input())
for _ in range(N):
	n = int(input())
	A = [int(i) for i in input().split(' ')]
	B = [int(i) for i in input().split(' ')]
	turn = 1
	totalA = 0
	totalB = 0
	while A:
		max = A[0] + B[0]
		maxi = 0
		for i in range(1, len(A)):
			curmax = A[i] + B[i]
			if curmax ** 2 > max ** 2:
				max = curmax
				maxi = i
			elif curmax ** 2 == max ** 2:
				if curmax * turn > max:
					max = curmax
					maxi = i
		if turn == 1:
			totalA += A[maxi]
		else:
			totalB += B[maxi]
		del A[maxi]
		del B[maxi]
		turn *= -1
	if totalA > totalB:
		print('First')
	elif totalA < totalB:
		print('Second')
	else:
		print('Tie')


from operator import add
for _ in range(int(input())):
	P1points = 0
	P2points = 0
	n = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	S = list(map(add, A, B))
	P1turn = True
	for _ in range(n):
		if P1turn:
			optimal = max(S)
			index = S.index(optimal)
			point = A.pop(index)
			B.pop(index)
			S.pop(index)
			P1points += point
			P1turn = False
			pass
		else:
			optimal = max(S)
			index = S.index(optimal)
			point = B.pop(index)
			A.pop(index)
			S.pop(index)
			P2points += point
			P1turn = True
			pass
		pass
	if P1points > P2points:
		print('First')
		pass
	elif P1points == P2points:
		print('Tie')
		pass
	else:
		print('Second')
		pass
	pass


t = int(input())
for case in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	my_list = list()
	for i in range(n):
		my_tuple = (a[i], b[i], i)
		my_list.append(my_tuple)
	my_list.sort(key=lambda x: x[0] + x[1], reverse=True)
	p1_score = 0
	p2_score = 0
	for index in range(n // 2):
		p1_score += my_list[index * 2][0]
		p2_score += my_list[index * 2 + 1][1]
	if n % 2 == 1:
		p1_score += my_list[-1][0]
	if p1_score > p2_score:
		print('First')
	elif p1_score < p2_score:
		print('Second')
	else:
		print('Tie')


import sys
for _ in range(int(input())):
	(n, a, b) = (int(input()), list(map(int, input().split())), list(map(int, input().split())))
	s = [a[x] + b[x] for x in range(n)]
	add = c = 0
	for i in range(n):
		index = s.index(max(s))
		if c == 0:
			add += a[index]
		if c == 1:
			add -= b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')


import sys

def findMaxDiff(a, b):
	maxv = 0
	pos = 0
	for i in range(0, len(a)):
		if a[i] + b[i] > maxv:
			maxv = a[i] + b[i]
			pos = i
	return pos
t = int(input().strip())
while t > 0:
	t -= 1
	n = int(input().strip())
	x = [int(x) for x in input().strip().split(' ')]
	y = [int(x) for x in input().strip().split(' ')]
	sumx = sum(x)
	sumy = sum(y)
	if n % 2 == 0:
		tmpx = x
		tmpy = y
		for i in range(0, n):
			if i % 2 == 0:
				pos = findMaxDiff(tmpx, tmpy)
				sumy = sumy - tmpy[pos]
			else:
				pos = findMaxDiff(tmpy, tmpx)
				sumx = sumx - tmpx[pos]
			tmpx.pop(pos)
			tmpy.pop(pos)
		if sumx > sumy:
			print('First')
		elif sumy > sumx:
			print('Second')
		else:
			print('Tie')
	else:
		tmpx = x
		tmpy = y
		for i in range(0, n - 1):
			if i % 2 == 0:
				pos = findMaxDiff(tmpx, tmpy)
				sumy = sumy - tmpy[pos]
			else:
				pos = findMaxDiff(tmpy, tmpx)
				sumx = sumx - tmpx[pos]
			tmpx.pop(pos)
			tmpy.pop(pos)
		if sumx > sumy - tmpy[0]:
			print('First')
		elif sumy - tmpy[0] > sumx:
			print('Second')
		else:
			print('Tie')


def diff(A, B):
	n = len(A)
	if n == 0:
		return 0
	opts = []
	for i in range(n):
		opts.append(A[i] - diff(B[:i] + B[i + 1:], A[:i] + A[i + 1:]))
	return max(opts)

def result(A, B):
	d = diff_2(A, B)
	if d > 0:
		return 'First'
	elif d == 0:
		return 'Tie'
	else:
		return 'Second'

def diff_2(A, B):
	totals = [a + b for (a, b) in zip(A, B)]
	indices_and_totals = [(i, t) for (i, t) in enumerate(totals)]
	indices_and_totals.sort(key=lambda x: -x[1])
	a_scores = sum([A[tup[0]] for (j, tup) in enumerate(indices_and_totals) if j % 2 == 0])
	b_scores = sum([B[tup[0]] for (j, tup) in enumerate(indices_and_totals) if j % 2 == 1])
	return a_scores - b_scores
T = int(input().strip())
for i in range(T):
	n = int(input().strip())
	A = [int(j) for j in input().strip().split(' ')]
	B = [int(j) for j in input().strip().split(' ')]
	print(result(A, B))


from functools import reduce

def read_numbers(n):
	return list(map(lambda x: int(x), input().split(' ', n)[0:n]))

def read_number():
	nums = read_numbers(1)
	return nums[0]

def max_for(ab, our_pos):
	the_max = None
	max_val = 0
	idx = 0
	for (a, b) in ab:
		their_pos = (our_pos + 1) % 2
		ours = (a, b)[our_pos]
		theirs = (a, b)[their_pos]
		val = ours - -theirs
		if the_max is None:
			the_max = (a, b)
			max_val = val
		if val is max(max_val, val):
			the_max = (a, b)
			max_val = val
	return the_max

def print_results(a, b):
	if a > b:
		fmt = 'First'
	elif a < b:
		fmt = 'Second'
	else:
		fmt = 'Tie'
	print(fmt.format(a, b))

def run_tests():
	tests = read_number()
	for test in range(0, tests):
		n = read_number()
		a = read_numbers(n)
		b = read_numbers(n)
		ab = list(zip(a, b))
		suma = 0
		sumb = 0
		for i in range(0, n):
			if i % 2 == 0:
				tup = max_for(ab, 0)
				ab.remove(tup)
				suma += tup[0]
			else:
				tup = max_for(ab, 1)
				ab.remove(tup)
				sumb += tup[1]
		print_results(suma, sumb)
run_tests()


import sys
import operator

def convertToInt(arr):
	ret_arr = []
	for el in arr:
		ret_arr.append(int(el))
	return ret_arr

def sumz(arr):
	return sum((i for i in arr))

def getGreatestInArr(arr, opp, turns):
	max = -10
	index = -1
	for i in range(len(arr)):
		if arr[i] + opp[i] > max:
			max = arr[i] + opp[i]
			index = i
	points = arr[index]
	del arr[index]
	del opp[index]
	return [points, arr, opp]

def getWinner(pa, pb):
	if pa > pb:
		return 'First'
	elif pb > pa:
		return 'Second'
	else:
		return 'Tie'

def playGame(turns, a, b):
	apoints = 0
	bpoints = 0
	player = 'a'
	points = 0
	for turn in range(0, turns):
		if player is 'a':
			result = getGreatestInArr(a, b, turns)
			apoints += result[0]
			a = result[1]
			b = result[2]
			player = 'b'
		else:
			result = getGreatestInArr(b, a, turns)
			bpoints += result[0]
			b = result[1]
			a = result[2]
			player = 'a'
	return getWinner(apoints, bpoints)

def gameSetup(n, arr):
	idx = 0
	while idx < len(arr):
		turns = convertToInt(arr[idx])
		j = idx + 1
		k = idx + 2
		a = convertToInt(arr[j])
		b = convertToInt(arr[k])
		print(playGame(turns[0], a, b))
		idx += 3
n = int(input().strip())
rounds = []
for i in range(0, n * 3, 3):
	rounds.append(input().strip().split(' '))
	rounds.append(input().strip().split(' '))
	rounds.append(input().strip().split(' '))
gameSetup(n, rounds)


from collections import deque
from itertools import cycle
for _ in range(int(input().strip())):
	n = int(input().strip())
	A = [int(x) for x in input().strip().split(' ')]
	B = [int(x) for x in input().strip().split(' ')]
	AB = sorted(((a + b, i) for (i, (a, b)) in enumerate(zip(A, B))), reverse=True)
	points = [A, B]
	score = [0, 0]
	for ((_, i), player) in zip(AB, cycle([0, 1])):
		score[player] += points[player][i]
	print('Tie' if score[0] == score[1] else 'First' if score[0] > score[1] else 'Second')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	b = [int(i) for i in input().split()]
	c = [a[i] + b[i] for i in range(n)]
	sum = 0
	turn = 0
	for i in range(n):
		m_ind = c.index(max(c))
		if turn == 0:
			sum += a[m_ind]
			turn += 1
		else:
			sum -= b[m_ind]
			turn -= 1
		a.pop(m_ind)
		b.pop(m_ind)
		c.pop(m_ind)
	if sum > 0:
		print('First')
	elif sum < 0:
		print('Second')
	else:
		print('Tie')


T = int(input())
for i in range(T):
	n = int(input())
	A = list(map(int, input().split(' ')))
	B = list(map(int, input().split(' ')))
	diffs = [(-a - b, i) for (i, (a, b)) in enumerate(zip(A, B))]
	A_sorted = sorted(diffs)
	total = 0
	as_turn = True
	for i in range(n):
		if as_turn:
			total += A[A_sorted[i][1]]
			as_turn = False
		else:
			total -= B[A_sorted[i][1]]
			as_turn = True
	if total == 0:
		print('Tie')
	elif total > 0:
		print('First')
	else:
		print('Second')


res = []
for _ in range(int(input())):
	n = int(input())
	(ar, br) = map(tuple, (map(int, input().split()) for _ in range(2)))
	choices = sorted(range(n), key=lambda i: ar[i] + br[i], reverse=True)
	val = sum(map(ar.__getitem__, choices[::2])) - sum(map(br.__getitem__, choices[1::2]))
	res.append('First' if val > 0 else 'Second' if val else 'Tie')
print('\n'.join(res))


from operator import itemgetter
T = int(input())
for _ in range(T):
	n = int(input())
	a = [int(x) for x in input().strip().split(' ')]
	b = [int(x) for x in input().strip().split(' ')]
	mylist = []
	for i in range(n):
		mylist.append((i, a[i] + b[i]))
	mylist = sorted(mylist, key=itemgetter(1), reverse=True)
	tot_A = 0
	tot_B = 0
	j = 0
	while j < n:
		if j % 2 == 0:
			tot_A += a[mylist[j][0]]
		else:
			tot_B += b[mylist[j][0]]
		j += 1
	if tot_A > tot_B:
		print('First')
	elif tot_B > tot_A:
		print('Second')
	else:
		print('Tie')


testcases_count = int(input())

def predict_game_result(a, b, n):
	next_to_move = 'a'
	a_sum = 0
	b_sum = 0
	for _ in range(n):
		if next_to_move == 'a':
			index = b.index(max(b))
			if max(a) >= max(b):
				index = a.index(max(a))
			a_sum += a[index]
			next_to_move = 'b'
		else:
			if max(b) >= max(a):
				index = b.index(max(b))
			index = a.index(max(a))
			b_sum += b[index]
			next_to_move = 'a'
		(a[index], b[index]) = (-9999999, -9999999)
	if a_sum > b_sum:
		return 'First'
	elif b_sum > a_sum:
		return 'Second'
	else:
		return 'Tie'
game_results = []
for _ in range(testcases_count):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	game_results.append(predict_game_result(a, b, n))
for result in game_results:
	print(result)


for _ in range(int(input())):
	input()
	(A, B) = (list(map(int, input().split())), list(map(int, input().split())))
	S = sorted(enumerate((x + y for (x, y) in zip(A, B))), reverse=True, key=lambda x: x[1])
	total = mod = 0
	for (key, _) in S:
		if mod == 0:
			total += A[key]
		if mod == 1:
			total -= B[key]
		mod = 1 - mod
	print('First' if total > 0 else 'Second' if total < 0 else 'Tie')


t = int(input())
for _ in range(t):
	input()
	a = [int(s) for s in input().split()]
	b = [int(s) for s in input().split()]
	s = sorted(((ai + bi, ai, bi) for (ai, bi) in zip(a, b)), reverse=True)
	r = sum((ai for (_, ai, _) in s[::2])) - sum((bi for (_, _, bi) in s[1::2]))
	print('Tie' if r == 0 else 'First' if r > 0 else 'Second')


t = int(input().strip())
for _ in range(t):
	n = int(input().strip())
	a = map(int, input().strip().split())
	b = map(int, input().strip().split())
	l = list(zip(a, b))
	l.sort(key=lambda v: v[0] + v[1])
	player = 0
	c = [0, 0]
	while l:
		v = l.pop()
		c[player] += v[player]
		player ^= 1
	if c[0] > c[1]:
		print('First')
	elif c[0] == c[1]:
		print('Tie')
	else:
		print('Second')


T = int(input())
for t in range(T):
	N = int(input())
	A = [int(x) for x in input().split(' ')]
	B = [int(x) for x in input().split(' ')]
	P1Point = 0
	P2Point = 0
	if sum(A) == sum(B):
		print('Tie')
		continue
	for n in range(N):
		sumAB = [a + b for (a, b) in zip(A, B)]
		index = sumAB.index(max(sumAB))
		if n % 2 == 0:
			P1Point = P1Point + A[index]
			A[index] = -1
			B[index] = -1
		else:
			P2Point = P2Point + B[index]
			A[index] = -1
			B[index] = -1
	if P1Point > P2Point:
		print('First')
	elif P2Point > P1Point:
		print('Second')
	else:
		print('Tie')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = sorted([(a[i] + b[i], a[i], b[i]) for i in range(n)], reverse=True)
	round = 0
	p1 = 0
	p2 = 0
	while c:
		if round % 2 == 0:
			x = c.pop(0)
			p1 += x[1]
		else:
			x = c.pop(0)
			p2 += x[2]
		round += 1
	if p1 > p2:
		print('First')
	elif p2 > p1:
		print('Second')
	else:
		print('Tie')


def best_choice(my_lst, enm_lst):
	best_i = 0
	for i in range(len(my_lst)):
		if my_lst[i] == -1:
			continue
		if my_lst[i] + enm_lst[i] > my_lst[best_i] + enm_lst[best_i]:
			best_i = i
	return best_i

def game(A, B):
	sum_A = 0
	sum_B = 0
	for i in range(len(A)):
		best_i = best_choice(A, B)
		if i % 2 == 0:
			sum_A += A[best_i]
		else:
			sum_B += B[best_i]
		A[best_i] = -1
		B[best_i] = -1
	if sum_A > sum_B:
		print('First')
	elif sum_A < sum_B:
		print('Second')
	else:
		print('Tie')
n = int(input())
for i in range(n):
	num = int(input())
	A = [int(i) for i in input().split(' ')]
	B = [int(i) for i in input().split(' ')]
	game(A, B)


t = int(input())
for ti in range(t):
	n = int(input())
	a = [int(ai) for ai in input().strip().split(' ')]
	b = [int(bi) for bi in input().strip().split(' ')]
	s = [a[x] + b[x] for x in range(n)]
	c = 0
	add = 0
	for i in range(n):
		index = s.index(max(s))
		if c == 0:
			add += a[index]
		if c == 1:
			add -= b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')


from itertools import cycle
for _ in range(int(input())):
	n = int(input())
	a = tuple((int(x) for x in input().split()))
	b = tuple((int(x) for x in input().split()))
	pref = sorted(range(n), key=lambda x: -a[x] - b[x])
	res = 0
	for (i, (src, mul)) in zip(pref, cycle(((a, 1), (b, -1)))):
		res += src[i] * mul
	if res > 0:
		print('First')
	elif res == 0:
		print('Tie')
	else:
		print('Second')


def sort(n, A, B):
	visited = {}
	List = []
	for i in range(n):
		Max = 0
		MaxV = 0
		for j in range(n):
			if not j in visited:
				Sum = A[j] + B[j]
				if Sum > MaxV:
					Max = j
					MaxV = Sum
		visited[Max] = 1
		List.append(Max)
	return List
T = int(input())
for t in range(T):
	n = int(input())
	A = input().strip().split(' ')
	B = input().strip().split(' ')
	for i in range(n):
		A[i] = int(A[i])
		B[i] = int(B[i])
	List = sort(n, A, B)
	pos = 0
	addition = [0, 0]
	for i in range(n):
		newValue = 0
		if pos == 0:
			newValue = A[List[i]]
		else:
			newValue = B[List[i]]
		addition[pos] = addition[pos] + newValue
		pos = (pos + 1) % 2
	if addition[0] > addition[1]:
		print('First')
	elif addition[0] == addition[1]:
		print('Tie')
	else:
		print('Second')


for _ in range(int(input())):
	n = int(input())
	a = [int(a_temp) for a_temp in input().strip().split(' ')]
	b = [int(a_temp) for a_temp in input().strip().split(' ')]
	s = [a[x] + b[x] for x in range(n)]
	add = c = 0
	for i in range(n):
		index = s.index(max(s))
		if c == 0:
			add += a[index]
		if c == 1:
			add -= b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')


t = int(input().strip())
for _ in range(t):
	n = int(input().strip())
	A = list(map(int, input().strip().split(' ')))
	B = list(map(int, input().strip().split(' ')))
	ApB = [A[i] + B[i] for i in range(n)]
	ApBsort = sorted([(i, v) for (i, v) in enumerate(ApB)], key=lambda tp: tp[1], reverse=True)
	order = [i[0] for i in ApBsort]
	aScore = sum([A[i] for i in order[0::2]])
	bScore = sum([B[i] for i in order[1::2]])
	if aScore > bScore:
		print('First')
	elif aScore < bScore:
		print('Second')
	else:
		print('Tie')


T = int(input().strip())
for i in range(T):
	N = int(input())
	A = [int(x) for x in input().split()]
	B = [int(x) for x in input().split()]
	Diff = [A[i] + B[i] for i in range(N)]
	Sum = 0
	for i in range(N):
		indexMax = 0
		j = 0
		for elt in Diff:
			if elt > Diff[indexMax]:
				indexMax = j
			j += 1
		if i % 2 == 0:
			Sum += A[indexMax]
		else:
			Sum -= B[indexMax]
		del Diff[indexMax]
		del A[indexMax]
		del B[indexMax]
	if Sum == 0:
		print('Tie')
	elif Sum > 0:
		print('First')
	else:
		print('Second')


T = int(input().strip())
for i in range(T):
	n = int(input().strip())
	a = [int(atemp) for atemp in input().strip().split(' ')]
	b = [int(btemp) for btemp in input().strip().split(' ')]
	c = [atemp + btemp for (atemp, btemp) in zip(a, b)]
	score = 0
	turn = 0
	for j in range(n):
		ind = c.index(max(c))
		if turn == 1:
			turn = 0
			score -= b[ind]
		else:
			turn = 1
			score += a[ind]
		c.pop(ind)
		a.pop(ind)
		b.pop(ind)
	if score > 0:
		print('First')
	elif score < 0:
		print('Second')
	else:
		print('Tie')


x = int(input())
res = []
for k in range(x):
	a = b = 0
	sa = sb = sc = []
	n = int(input())
	s1 = input()
	s2 = input()
	sa = s1.split(' ')
	sb = s2.split(' ')
	for i in range(n):
		sc.append(int(sa[i]) + int(sb[i]))
	add = c = 0
	for i in range(n):
		index = sc.index(max(sc))
		if c == 0:
			add += int(sa[index])
		if c == 1:
			add -= int(sb[index])
		sc.pop(index)
		sa.pop(index)
		sb.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')


num_test_cases = int(input())
for case in range(num_test_cases):
	num_moves = int(input())
	a = [int(x) for x in input().split(' ')]
	b = [int(x) for x in input().split(' ')]
	s = [a[x] + b[x] for x in range(num_moves)]
	player_one_points = 0
	player_two_points = 0
	player_turn = 1
	for move in range(num_moves):
		max_idx = s.index(max(s))
		if player_turn == 1:
			player_one_points += a[max_idx]
			player_turn = 2
		elif player_turn == 2:
			player_two_points += b[max_idx]
			player_turn = 1
		del a[max_idx]
		del b[max_idx]
		del s[max_idx]
	if player_one_points == player_two_points:
		print('Tie')
	elif player_one_points > player_two_points:
		print('First')
	elif player_one_points < player_two_points:
		print('Second')


for T in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	S = [A[x] + B[x] for x in range(n)]
	total = 0
	c = 0
	for i in range(n):
		index = S.index(max(S))
		if c == 0:
			total += A[index]
		else:
			total -= B[index]
		A.pop(index)
		B.pop(index)
		S.pop(index)
		c = 1 - c
	if total > 0:
		print('First')
	elif total < 0:
		print('Second')
	else:
		print('Tie')


t = input()
for j in range(int(t)):
	(n, a, b) = (int(input()), list(map(int, input().split())), list(map(int, input().split())))
	s = [a[x] + b[x] for x in range(n)]
	add = c = 0
	for i in range(n):
		index = s.index(max(s))
		if c == 0:
			add += a[index]
		if c == 1:
			add -= b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')


T = int(input())
for _ in range(T):
	n = int(input())
	count = 0
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	C = [A[i] + B[i] for i in range(n)]
	sumA = 0
	sumB = 0
	while count < n:
		if count % 2 == 0:
			idx = C.index(max(C))
			sumA += A[idx]
			A.pop(idx)
			B.pop(idx)
			C.pop(idx)
		else:
			idx = C.index(max(C))
			sumB += B[idx]
			A.pop(idx)
			B.pop(idx)
			C.pop(idx)
		count += 1
	if sumA > sumB:
		print('First')
	elif sumA == sumB:
		print('Tie')
	else:
		print('Second')


T = int(input())
for _ in range(T):
	n = int(input())
	A = [int(a) for a in input().split()]
	B = [int(a) for a in input().split()]
	used = [1 for i in range(n)]
	p1 = 0
	p2 = 0
	turn = 0
	while sum(used) > 0:
		C = [A[i] + B[i] for i in range(n)]
		mxA = 0
		indA = 0
		for (i, el) in enumerate(C):
			if used[i] == 1 and el > mxA:
				mxA = el
				indA = i
		mxB = 0
		indB = 0
		for (i, el) in enumerate(C):
			if used[i] == 1 and el > mxB:
				mxB = el
				indB = i
		if turn == 0:
			if mxA > mxB:
				used[indA] = 0
				p1 += mxA
			else:
				used[indB] = 0
				p1 += A[indB]
		elif mxA < mxB:
			used[indB] = 0
			p2 += mxB
		else:
			used[indA] = 0
			p2 += B[indA]
		turn = 1 - turn
	if p1 > p2:
		print('First')
	elif p2 > p1:
		print('Second')
	else:
		print('Tie')


def compute(n, a, b):
	s = [a[x] + b[x] for x in range(n)]
	add = c = 0
	for i in range(n):
		index = s.index(max(s))
		if c == 0:
			add += a[index]
		if c == 1:
			add -= b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')
a = int(input())
for x in range(a):
	q1 = int(input())
	aa = [int(x) for x in input().split(' ')]
	bb = [int(x) for x in input().split(' ')]
	compute(q1, aa, bb)


for _ in range(int(input())):
	n = int(input())
	A = [int(x) for x in input().split()]
	B = [int(x) for x in input().split()]
	D = sorted([a + b for (a, b) in zip(A, B)])[::-1]
	s = sum(D[::2])
	if s > sum(B):
		print('First')
	elif s == sum(B):
		print('Tie')
	else:
		print('Second')


import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache, reduce
INF = float('inf')
sys.setrecursionlimit(10 ** 7)
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]

def inside(y: int, x: int, H: int, W: int) -> bool:
	return 0 <= y < H and 0 <= x < W

def solve(n, A_list, B_list):
	C = []
	for (i, (a, b)) in enumerate(zip(A_list, B_list)):
		C.append((a + b, i))
	(f, s) = (0, 0)
	for (i, (c, j)) in enumerate(sorted(C, reverse=True)):
		if i % 2 == 0:
			f += A_list[j]
		else:
			s += B_list[j]
	return (f, s)

def main():
	T = int(input())
	for _ in range(T):
		n = int(input())
		A_list = list(map(int, input().split()))
		B_list = list(map(int, input().split()))
		(a, b) = solve(n, A_list, B_list)
		if a == b:
			print('Tie')
		else:
			print('First' if a > b else 'Second')
main()


import heapq
N = int(input())
for i in range(N):
	L = int(input())
	A = [int(x) for x in input().split()]
	B = [int(x) for x in input().split()]
	h = []
	for j in range(L):
		heapq.heappush(h, ((A[j] + B[j]) * -1, A[j], B[j]))
	(s, k) = ([0, 0], 0)
	while h:
		s[k] += heapq.heappop(h)[k + 1]
		k = (k + 1) % 2
	if s[0] == s[1]:
		print('Tie')
	elif s[0] > s[1]:
		print('First')
	else:
		print('Second')


def parseInput(f):
	return [f(x) for x in input().split()]
t = int(input())
for _ in range(t):
	n = int(input())
	A = parseInput(int)
	B = parseInput(int)
	both = [(A[i] + B[i], i) for i in range(n)]
	both.sort(reverse=True)
	first = 0
	second = 0
	for i in range(n):
		if i % 2:
			second += B[both[i][1]]
		else:
			first += A[both[i][1]]
	answer = first - second
	if answer > 0:
		print('First')
	elif answer == 0:
		print('Tie')
	else:
		print('Second')


for _ in range(int(input())):
	(n, a, b) = (int(input()), list(map(int, input().split())), list(map(int, input().split())))
	s = [a[x] + b[x] for x in range(n)]
	add = c = 0
	for i in range(n):
		index = s.index(max(s))
		if c == 0:
			add += a[index]
		if c == 1:
			add -= b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')


import sys
data = sys.stdin.readlines()
T = int(data[0])

def run_game(N, a, b):
	c = [a[i] + b[i] for i in range(N)]
	cs = [i for (i, x) in sorted(enumerate(c), key=lambda y: y[1])]
	(p1, p2) = (0, 0)
	for i in range(N):
		if i % 2 == 0:
			p1 += a[cs.pop(-1)]
		else:
			p2 += b[cs.pop(-1)]
	if p1 > p2:
		print('First')
	elif p1 == p2:
		print('Tie')
	else:
		print('Second')
for k in range(T):
	N = int(data[3 * k + 1])
	a = list(map(int, data[3 * k + 2].split()))
	b = list(map(int, data[3 * k + 3].split()))
	run_game(N, a, b)


from operator import itemgetter
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = sorted([(abs(a[i] + b[i]), i) for i in range(n)], reverse=True, key=itemgetter(0))
	a_sum = 0
	b_sum = 0
	for i in range(n):
		(num, index) = c[i]
		if i % 2 == 0:
			a_sum += a[index]
		else:
			b_sum += b[index]
	if a_sum > b_sum:
		print('First')
	elif a_sum < b_sum:
		print('Second')
	else:
		print('Tie')


def choose(turn, S, A, B):
	max_diff = max(S)
	index_value = S.index(max_diff)
	for i in range(len(S)):
		if S[i] == max_diff:
			if turn == 'As_Turn' and A[i] > A[index_value]:
				index_value = i
			elif turn == 'Bs_Turn' and B[i] > B[index_value]:
				index_value = i
	return index_value
T = int(input().strip())
str = ''
S = []
for i in range(T):
	n = int(input().strip())
	A = list(map(int, input().strip().split()))
	B = list(map(int, input().strip().split()))
	for i in range(n):
		S.append(abs(A[i] + B[i]))
	(As_Score, Bs_Score) = (0, 0)
	(As_Turn, Bs_Turn) = (True, False)
	for i in range(n):
		if As_Turn == True:
			i = choose('As_Turn', S, A, B)
			As_Score = As_Score + A[i]
			del S[i], A[i], B[i]
			As_Turn = False
			Bs_Turn = True
			continue
		if Bs_Turn == True:
			i = choose('Bs_Turn', S, A, B)
			Bs_Score = Bs_Score + B[i]
			del S[i], A[i], B[i]
			Bs_Turn = False
			As_Turn = True
			continue
	if As_Score > Bs_Score:
		str = str + 'First\n'
	elif As_Score < Bs_Score:
		str = str + 'Second\n'
	else:
		str = str + 'Tie\n'
print(str.strip())


def game_outcome(n, a, b):
	(score_a, score_b) = (0, 0)
	s = [a[i] + b[i] for i in range(n)]
	for r in range(n):
		index = s.index(max(s))
		if r % 2 == 0:
			score_a += a[index]
		else:
			score_b += b[index]
		a.pop(index)
		b.pop(index)
		s.pop(index)
	if score_a > score_b:
		return 'First'
	elif score_a < score_b:
		return 'Second'
	else:
		return 'Tie'
games = int(input().strip())
for i in range(games):
	n = int(input().strip())
	a = list(map(int, input().strip().split(' ')))
	b = list(map(int, input().strip().split(' ')))
	print(game_outcome(n, a, b))


for _ in range(int(input())):
	(n, a, b) = (int(input()), list(map(int, input().split())), list(map(int, input().split())))
	s = [a[x] + b[x] for x in range(n)]
	add = c = 0
	for i in range(n):
		index = s.index(max(s))
		if c == 0:
			add += a[index]
		if c == 1:
			add -= b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	s = [a[x] + b[x] for x in range(n)]
	add = c = 0
	for i in range(n):
		index = s.index(max(s))
		if c == 0:
			add += a[index]
		if c == 1:
			add -= b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')


for _ in range(int(input())):
	(n, sa, sb) = (int(input()), 0, 0)
	A = [int(x) for x in input().split(' ')]
	B = [int(x) for x in input().split(' ')]
	D = sorted([(A[i] + B[i], i) for i in range(n)])[::-1]
	for i in range(n):
		if i & 1:
			sb += B[D[i][1]]
		else:
			sa += A[D[i][1]]
	if sa > sb:
		print('First')
	elif sa < sb:
		print('Second')
	else:
		print('Tie')


import os
import sys

def funGame(a, b):
	importance = [a[i] + b[i] for i in range(len(a))]
	(s_a, s_b) = (0, 0)
	for t in range(len(a)):
		i = argmax(importance)
		if t % 2 == 0:
			s_a += a[i]
		else:
			s_b += b[i]
		a[i] = 0
		b[i] = 0
		importance[i] = 0
	if s_a > s_b:
		return 'First'
	elif s_a == s_b:
		return 'Tie'
	else:
		return 'Second'

def argmax(ar):
	max_seen = -1
	arg_max_seen = -1
	for i in range(len(ar)):
		if ar[i] > max_seen:
			max_seen = ar[i]
			arg_max_seen = i
	return arg_max_seen
t = int(input())
for t_itr in range(t):
	n = int(input())
	a = list(map(int, input().rstrip().split()))
	b = list(map(int, input().rstrip().split()))
	result = funGame(a, b)
	print(result)


import sys
from time import time
mscache = dict()

def max_sum(aa, bb):
	t = (aa, bb)
	if t in mscache:
		return mscache[t]
	if not t[0]:
		rval = (0, 0)
	else:
		(sm1, sm2) = (None, None)
		for index in range(len(aa)):
			(lsm, rsm) = (aa[index], 0)
			(rdelta, ldelta) = max_sum(bb[:index] + bb[index + 1:], aa[:index] + aa[index + 1:])
			lsm += ldelta
			rsm += rdelta
			delta = lsm - rsm
			if sm1 is None or delta > sm1 - sm2:
				(sm1, sm2) = (lsm, rsm)
		rval = (sm1, sm2)
	mscache[t] = rval
	return rval

def solve_bf(aa, bb):
	print('aa=%s\nbb=%s' % (aa, bb), file=sys.stderr)
	mscache.clear()
	(l, r) = max_sum(tuple(aa), tuple(bb))
	print('\tl=%d r=%d' % (l, r), file=sys.stderr)
	if l < r:
		return -1
	if l == r:
		return 0
	return 1

def solve(aa, bb):
	print('len(aa)=%d' % (len(aa),), file=sys.stderr)
	dd = [(a + b, max(a, b), i) for (i, (a, b)) in enumerate(zip(aa, bb))]
	dd.sort(reverse=True)
	dd = [i for (_, _, i) in dd]
	l = sum((aa[dd[i]] for i in range(0, len(dd), 2)))
	r = sum((bb[dd[i]] for i in range(1, len(dd), 2)))
	if l > r:
		return 1
	if l == r:
		return 0
	return 2
	l1 = sum((aa[dd[i]] for i in range(0, len(dd), 2)))
	l2 = sum((aa[dd[i]] for i in range(1, len(dd), 2)))
	r1 = sum((bb[dd[i]] for i in range(1, len(dd), 2)))
	r2 = sum((bb[dd[i]] for i in range(0, len(dd), 2)))
	print('\tl1=%d r1=%d' % (l1, r1), file=sys.stderr)
	print('\tl2=%d r2=%d' % (l2, r2), file=sys.stderr)
	if l1 > r1 or l2 > r2:
		return 1
	if l1 == r1 or l2 == r2:
		return 0
	return 2
tm = time()
t = int(input())
ss = ['Tie', 'First', 'Second']
for _ in range(t):
	_ = int(input())
	aa = list(map(int, input().split()))
	bb = list(map(int, input().split()))
	print(ss[solve(aa, bb)])
print('time elapsed: %s' % (time() - tm,), file=sys.stderr)


for _ in range(int(input())):
	input()
	a = map(int, input().split())
	b = map(int, input().split())
	c = list(zip(a, b))
	c.sort(key=sum, reverse=True)
	ascore = sum((x for (x, _) in c[::2]))
	bscore = sum((y for (_, y) in c[1::2]))
	print('First' if ascore > bscore else 'Second' if bscore > ascore else 'Tie')


import math
import os
import random
import re
import sys

def funGame(a, b, n):
	s = [a[x] + b[x] for x in range(n)]
	add = c = 0
	for i in range(n):
		index = s.index(max(s))
		if c == 0:
			add += a[index]
		if c == 1:
			add -= b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
		return 'First'
	elif add < 0:
		print('Second')
		return 'Second'
	else:
		print('Tie')
		return 'Tie'
os.environ['OUTPUT_PATH'] = 'test1.txt'
fptr = open(os.environ['OUTPUT_PATH'], 'w')
t = int(input())
for t_itr in range(t):
	n = int(input())
	a = list(map(int, input().rstrip().split()))
	b = list(map(int, input().rstrip().split()))
	result = funGame(a, b, n)
	fptr.write(result + '\n')
fptr.close()


for _ in range(int(input())):
	(n, a, b) = (int(input()), input(), input())
	a = list(map(int, a.split()))
	b = list(map(int, b.split()))
	s = [a[x] + b[x] for x in range(n)]
	add = c = 0
	for i in range(n):
		index = s.index(max(s))
		if c == 0:
			add += a[index]
		if c == 1:
			add -= b[index]
		s.pop(index)
		a.pop(index)
		b.pop(index)
		c = 1 - c
	if add > 0:
		print('First')
	elif add < 0:
		print('Second')
	else:
		print('Tie')