There are N piles where the i^{th} pile consists of A_{i} stones.

Chef and Chefina are playing a game taking alternate turns with Chef starting first.  
In his/her turn, a player can choose any non-empty pile and remove exactly 1 stone from it. 

The game ends when exactly 2 piles become empty. The player who made the last move wins.  
Determine the winner if both players play optimally.

------ Input Format ------ 

- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of multiple lines of input.
- The first line of each test case contains a single integer N denoting the number of piles.
- Next line contains N space-separated integers A_{1}, A_{2}, \dots, A_{N} - denoting the number of stones in each pile.

------ Output Format ------ 

For each test case, output CHEF if Chef wins the game, otherwise output CHEFINA.

Note that the output is case-insensitive i.e. CHEF, Chef, cHeF, and chef are all considered the same.

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$2 ≤ N ≤ 10^{5}$
$1 ≤ A_{i} ≤ 10^{9}$
- Sum of $N$ over all test cases does not exceed $2 \cdot 10^{5}$.

----- Sample Input 1 ------ 
2
2
5 10
3
1 1 3

----- Sample Output 1 ------ 
CHEF
CHEFINA

----- explanation 1 ------ 
Test Case $1$: The game will end when both piles become empty. Thus, the game will last exactly $15$ moves with last move made by Chef.

Test Case $2$: It can be shown that Chefina has a winning strategy.

Source: codechef | Difficulty: MEDIUM_HARD
Tags: Game theory


Solutions:
t = int(input())
for tt in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	arr1 = arr
	for i in range(3):
		for j in range(n - 1 - i):
			if arr1[j] < arr1[j + 1]:
				temp = arr1[j]
				arr1[j] = arr1[j + 1]
				arr1[j + 1] = temp
	min1 = arr1[n - 1]
	min2 = arr1[n - 2]
	min3 = arr1[n - 3]
	sum = 0
	cnt1 = 0
	cnt2 = 0
	for i in range(n):
		sum = sum + arr[i]
		if arr[i] == 1:
			cnt1 = cnt1 + 1
		elif arr[i] == 2:
			cnt2 = cnt2 + 1
	if cnt1 >= 2:
		if (sum - n) % 2 == 1:
			print('CHEF')
		else:
			print('CHEFINA')
	elif cnt1 == 1:
		if sum % 2 == 1 or (cnt2 >= 1 and (sum - n) % 2 == 1):
			print('CHEF')
		else:
			print('CHEFINA')
	elif sum % 2 == 1:
		print('CHEF')
	else:
		print('CHEFINA')


for _ in range(int(input())):
	num = int(input())
	lis = [int(x) for x in input().split()]
	if lis.count(1) == 0:
		if sum(lis) % 2 == 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif lis.count(1) >= 2:
		if (sum(lis) - num) % 2 == 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif lis.count(2) >= 1 and num % 2 != 0:
		print('CHEF')
	elif sum(lis) % 2 == 0:
		print('CHEFINA')
	else:
		print('CHEF')


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	arr = list(map(int, stdin.readline().split()))
	if arr.count(1) == 1 and arr.count(2) > 0:
		print('CHEF' if (sum(arr) - n) % 2 != 0 or sum(arr) % 2 != 0 else 'CHEFINA')
	elif arr.count(1) >= 2:
		print('CHEF' if (sum(arr) - n) % 2 != 0 else 'CHEFINA')
	else:
		print('CHEF' if sum(arr) % 2 != 0 else 'CHEFINA')


import sys
import os
import math
import collections
T = int(input())
for _ in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	(odd, val) = (0, 0)
	for i in A:
		if i != 1:
			if i % 2:
				odd += 1
				val += i
	On = A.count(1)
	Non = N - On
	even = N - odd - On
	To = A.count(2)
	if On == 1:
		if val % 2 == 0:
			print('CHEF')
		elif To == 0:
			print('CHEFINA')
		else:
			val -= 2
			Non -= 1
			if abs(val - Non) % 2:
				print('CHEFINA')
			else:
				print('CHEF')
	elif On > 1:
		if abs(val - Non) % 2:
			print('CHEF')
		else:
			print('CHEFINA')
	elif odd % 2:
		print('CHEF')
	else:
		print('CHEFINA')


for i in range(int(input())):
	n = int(input())
	l = [int(x) for x in input().split()]
	if l.count(1) == 0:
		if sum(l) % 2 == 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif l.count(1) >= 2:
		if (sum(l) - n) % 2 == 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif l.count(2) >= 1 and n % 2 != 0:
		print('CHEF')
	elif sum(l) % 2 == 0:
		print('CHEFINA')
	else:
		print('CHEF')


for _ in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	s = 0
	ones = 0
	twos = 0
	for i in range(n):
		ones += li[i] == 1
		twos += li[i] == 2
		s += li[i]
	if ones > 1:
		if s - n & 1:
			print('CHEF')
		else:
			print('CHEFINA')
	elif ones == 1:
		if s & 1:
			print('CHEF')
		elif twos == 0:
			print('CHEFINA')
		elif s - n & 1:
			print('CHEF')
		else:
			print('CHEFINA')
	elif s & 1:
		print('CHEF')
	else:
		print('CHEFINA')


def f(a):
	k = 0
	for i in a:
		if i != 1:
			k += i
	if k % 2 == 0:
		return True
	else:
		return False
t = int(input())
for i in range(t):
	n = int(input())
	s = 0
	z = input()
	a = [int(val) for val in z.split()]
	if a.count(1) == 0:
		for k in a:
			s += k - 2
		if s % 2 == 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif a.count(1) == 1:
		if f(a):
			print('CHEF')
		elif a.count(2) == 0:
			print('CHEFINA')
		else:
			for k in a:
				if k != 1:
					s += k - 1
			if s % 2 == 0:
				print('CHEFINA')
			else:
				print('CHEF')
	else:
		for k in a:
			if k != 1:
				s += k - 1
		if s % 2 == 0:
			print('CHEFINA')
		else:
			print('CHEF')


t = int(input())
for i in range(t):
	n = int(input())
	s = input()
	l = list(map(int, s.split()))
	c1 = l.count(1)
	c2 = l.count(2)
	a = sum(l) - n
	if c1 >= 2:
		if a % 2 == 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif c1 == 1 and c2 >= 1:
		if a % 2 == 1 or sum(l) % 2 == 1:
			print('CHEF')
		else:
			print('CHEFINA')
	elif sum(l) % 2 == 0:
		print('CHEFINA')
	else:
		print('CHEF')


def solve(arr, n):
	m = 'CHEF'
	f = 'CHEFINA'
	cnt1 = 0
	cnt2 = 0
	oddPilescnt = 0
	tot = 0
	pileExc1 = 0
	for i in arr:
		if i == 1:
			cnt1 += 1
		else:
			if i == 2:
				cnt2 += 1
			tot += i
			pileExc1 += 1
			if i % 2 != 0:
				oddPilescnt += 1
	if cnt1 == 1:
		if oddPilescnt % 2 == 0:
			return m
		if cnt2 == 0:
			return f
		tot -= 2
		pileExc1 -= 1
		if (tot - pileExc1) % 2 != 0:
			return f
		else:
			return m
	elif cnt1 > 1:
		if (tot - pileExc1) % 2 != 0:
			return m
		else:
			return f
	elif oddPilescnt % 2 != 0:
		return m
	else:
		return f
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(solve(arr, n))


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	(b, c, d, e, f) = (0, 0, 0, 0, 0)
	for j in range(n):
		if l[j] == 1:
			d += 1
		else:
			if l[j] == 2:
				c += 1
			e += l[j]
			f += 1
			if l[j] % 2 != 0:
				b += 1
	if d == 1:
		if b % 2 == 0:
			print('CHEF')
			continue
		if c == 0:
			print('CHEFINA')
			continue
		e -= 2
		f -= 1
		if (e - f) % 2 != 0:
			print('CHEFINA')
			continue
		else:
			print('CHEF')
			continue
	elif d > 1:
		if (e - f) % 2 != 0:
			print('CHEF')
			continue
		else:
			print('CHEFINA')
			continue
	if b % 2 != 0:
		print('CHEF')
		continue
	else:
		print('CHEFINA')
		continue


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	o = l.count(1)
	e = l.count(2)
	y = sum(l) - n
	if o >= 2:
		if y % 2 == 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif o == 1 and e >= 1:
		if (sum(l) - n) % 2 == 1 or sum(l) % 2 == 1:
			print('CHEF')
		else:
			print('CHEFINA')
	elif sum(l) % 2 == 0:
		print('CHEFINA')
	else:
		print('CHEF')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))[:n]
	b = 0
	c = 0
	d = 0
	e = 0
	f = 0
	for i in range(n):
		if arr[i] == 1:
			d += 1
		else:
			if arr[i] == 2:
				c += 1
			e += arr[i]
			f += 1
			if arr[i] % 2 != 0:
				b += 1
	if d == 1:
		if b % 2 == 0:
			print('CHEF')
			continue
		if c == 0:
			print('CHEFINA')
			continue
		e -= 2
		f -= 1
		if (e - f) % 2 != 0:
			print('CHEFINA')
			continue
		else:
			print('CHEF')
			continue
	elif d > 1:
		if (e - f) % 2 != 0:
			print('CHEF')
			continue
		else:
			print('CHEFINA')
			continue
	if b % 2 != 0:
		print('CHEF')
		continue
	else:
		print('CHEFINA')
		continue


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	total = sum(a)
	ones = a.count(1)
	twos = a.count(2)
	if ones >= 2:
		if (total - n) % 2 != 0:
			print('CHEF')
		else:
			print('CHEFINA')
	elif ones == 1:
		if total % 2 != 0 or (twos >= 1 and (total - n) % 2 != 0):
			print('CHEF')
		else:
			print('CHEFINA')
	elif ones == 0:
		if total % 2 != 0:
			print('CHEF')
		else:
			print('CHEFINA')


T = int(input())
for i in range(T):
	n = int(input())
	arr = list(map(int, input().split()))
	s = sum(arr)
	(one, two) = (arr.count(1), arr.count(2))
	if one == 1 and two >= 1:
		if s % 2 == 1 or (s - n) % 2 == 1:
			print('CHEF')
		else:
			print('CHEFINA')
	elif one >= 2:
		s = s - n
		if s % 2 == 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif s % 2 == 0:
		print('CHEFINA')
	else:
		print('CHEF')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	count = a.count(1)
	count2 = a.count(2)
	if count == 0:
		if s % 2 != 0:
			print('CHEF')
		else:
			print('CHEFINA')
	elif count == 1:
		if s % 2 != 0:
			print('CHEF')
		elif count2 == 0:
			print('CHEFINA')
		elif (s - n) % 2 != 0:
			print('CHEF')
		else:
			print('CHEFINA')
	elif (s - n) % 2 != 0:
		print('CHEF')
	else:
		print('CHEFINA')


def getWinner(piles):
	o1 = o2 = o3 = o4 = o5 = 0
	CHEF = 'CHEF'
	for noStones in piles:
		if noStones == 1:
			o3 += 1
		else:
			if noStones == 2:
				o2 += 1
			o4 += noStones
			o5 += 1
			if noStones & 1:
				o1 += 1
	if o3 == 1:
		if not o1 & 1:
			return CHEF
		if o2 == 0:
			return 'CHEFINA'
		o4 -= 2
		o5 -= 1
		if o4 - o5 & 1:
			return 'CHEFINA'
		else:
			return CHEF
	if o3 > 1:
		if o4 - o5 & 1:
			return CHEF
		else:
			return 'CHEFINA'
	if o1 & 1:
		return CHEF
	else:
		return 'CHEFINA'
n = int(input())
for a in range(n):
	input()
	l = input().split()
	print(getWinner([int(i) for i in l]))


def f(piles):
	oddPilesCountExcept1 = 0
	twoPilesCount = 0
	onePilesCount = 0
	sumPilesExcept1 = 0
	pilesExcept1 = 0
	for noStones in piles:
		if noStones == 1:
			onePilesCount += 1
		else:
			if noStones == 2:
				twoPilesCount += 1
			sumPilesExcept1 += noStones
			pilesExcept1 += 1
			if noStones & 1:
				oddPilesCountExcept1 += 1
	if onePilesCount == 1:
		if not oddPilesCountExcept1 & 1:
			return 'CHEF'
		if twoPilesCount == 0:
			return 'CHEFINA'
		sumPilesExcept1 -= 2
		pilesExcept1 -= 1
		if sumPilesExcept1 - pilesExcept1 & 1:
			return 'CHEFINA'
		else:
			return 'CHEF'
	if onePilesCount > 1:
		if sumPilesExcept1 - pilesExcept1 & 1:
			return 'CHEF'
		else:
			return 'CHEFINA'
	if oddPilesCountExcept1 & 1:
		return 'CHEF'
	else:
		return 'CHEFINA'
t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(f(arr))


def solve(piles):
	odd = 0
	two = 0
	one = 0
	sumpiles = 0
	pilesnotone = 0
	for x in piles:
		if x == 1:
			one += 1
		else:
			if x == 2:
				two += 1
			sumpiles += x
			pilesnotone += 1
			if x % 2 == 1:
				odd += 1
	if one == 1:
		if odd % 2 == 0:
			return 'CHEF'
		if two == 0:
			return 'CHEFINA'
		sumpiles -= 2
		pilesnotone -= 1
		if (sumpiles - pilesnotone) % 2 == 1:
			return 'CHEFINA'
		else:
			return 'CHEF'
	if one > 1:
		if (sumpiles - pilesnotone) % 2 == 1:
			return 'CHEF'
		else:
			return 'CHEFINA'
	if odd % 2 == 1:
		return 'CHEF'
	else:
		return 'CHEFINA'
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(solve(arr))


def getWinner(piles):
	oddPilesCountExcep1 = 0
	twoPilesCount = 0
	onePilesCount = 0
	sumPilesExcept1 = 0
	pilesExcept1 = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for noStones in piles:
		if noStones == 1:
			onePilesCount += 1
		else:
			if noStones == 2:
				twoPilesCount += 1
			sumPilesExcept1 += noStones
			pilesExcept1 += 1
			if noStones & 1:
				oddPilesCountExcep1 += 1
	if onePilesCount == 1:
		if not oddPilesCountExcep1 & 1:
			return CHEF
		if twoPilesCount == 0:
			return CHEFINA
		sumPilesExcept1 -= 2
		pilesExcept1 -= 1
		if sumPilesExcept1 - pilesExcept1 & 1:
			return CHEFINA
		else:
			return CHEF
	if onePilesCount > 1:
		if sumPilesExcept1 - pilesExcept1 & 1:
			return CHEF
		else:
			return CHEFINA
	if oddPilesCountExcep1 & 1:
		return CHEF
	else:
		return CHEFINA
	raise Exception('lol')
t = int(input())
while t > 0:
	input()
	print(getWinner([int(i) for i in input().split()]))
	t -= 1


def govind(piles):
	oddp = 0
	twop = 0
	onep = 0
	sump = 0
	pilesp = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for noStones in piles:
		if noStones == 1:
			onep += 1
		else:
			if noStones == 2:
				twop += 1
			sump += noStones
			pilesp += 1
			if noStones & 1:
				oddp += 1
	if onep == 1:
		if not oddp & 1:
			return CHEF
		if twop == 0:
			return CHEFINA
		sump -= 2
		pilesp -= 1
		if sump - pilesp & 1:
			return CHEFINA
		else:
			return CHEF
	if onep > 1:
		if sump - pilesp & 1:
			return CHEF
		else:
			return CHEFINA
	if oddp & 1:
		return CHEF
	else:
		return CHEFINA
	raise Exception('lol')
t = int(input())
while t > 0:
	input()
	print(govind([int(i) for i in input().split()]))
	t -= 1


t = int(input())
while t > 0:
	n = int(input())
	(even, no2, no1, sum2, rem) = (0, 0, 0, 0, 0)
	arr = list(map(int, input().split()))
	for i in range(n):
		if arr[i] == 1:
			no1 += 1
		else:
			if arr[i] == 2:
				no2 += 1
			sum2 += arr[i]
			if arr[i] & 1:
				even += 1
	rem = len(arr) - no1
	if no1 == 1:
		if even % 2 == 0:
			print('CHEF')
		elif no2 == 0:
			print('CHEFINA')
		else:
			sum2 -= 2
			rem -= 1
			if sum2 - rem & 1:
				print('CHEFINA')
			else:
				print('CHEF')
	elif no1 > 1:
		if sum2 - rem & 1:
			print('CHEF')
		else:
			print('CHEFINA')
	elif even & 1:
		print('CHEF')
	else:
		print('CHEFINA')
	t -= 1


def winner(piles):
	oddpilecntex1 = 0
	twopilecnt = 0
	onepilecnt = 0
	sumpileex1 = 0
	pileex1 = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for noStone in piles:
		if noStone == 1:
			onepilecnt += 1
		else:
			if noStone == 2:
				twopilecnt += 1
			sumpileex1 += noStone
			pileex1 += 1
			if noStone & 1:
				oddpilecntex1 += 1
	if onepilecnt == 1:
		if not oddpilecntex1 & 1:
			return CHEF
		if twopilecnt == 0:
			return CHEFINA
		sumpileex1 -= 2
		pileex1 -= 1
		if sumpileex1 - pileex1 & 1:
			return CHEFINA
		else:
			return CHEF
	if onepilecnt > 1:
		if sumpileex1 - pileex1 & 1:
			return CHEF
		else:
			return CHEFINA
	if oddpilecntex1 & 1:
		return CHEF
	else:
		return CHEFINA
t = int(input())
for _ in range(t):
	input()
	print(winner([int(i) for i in input().split()]))


def sol():
	t = int(input())
	for i in range(0, t):
		n = int(input())
		arr = list(map(int, input().split()))
		u = 0
		v = 0
		w = 0
		x = 0
		y = 0
		for i in range(0, n):
			if arr[i] == 1:
				w += 1
			else:
				if arr[i] == 2:
					v += 1
				x += arr[i]
				y += 1
				if arr[i] % 2:
					u += 1
		if w == 1:
			if not u % 2:
				print('CHEF')
				continue
			if v == 0:
				print('CHEFINA')
				continue
			x -= 2
			y -= 1
			if (x - y) % 2:
				print('CHEFINA')
				continue
			else:
				print('CHEF')
				continue
		elif w > 1:
			if (x - y) % 2:
				print('CHEF')
				continue
			else:
				print('CHEFINA')
				continue
		if u % 2:
			print('CHEF')
			continue
		else:
			print('CHEFINA')
			continue
	return 0
sol()


for _ in range(int(input())):
	n = int(input())
	l = input().split(' ')
	a = [int(i) for i in l]
	o = 0
	t = 0
	od = 0
	s = 0
	for i in a:
		if i == 1:
			o += 1
		else:
			if i == 2:
				t += 1
			if i % 2 != 0:
				od += 1
			s += i
	if o == 1:
		s -= 2
		if od % 2 == 0:
			print('CHEF')
		elif t == 0:
			print('CHEFINA')
		elif (s - (n - o - 1)) % 2 != 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif o > 1:
		if int(s - (n - o)) % 2 != 0:
			print('CHEF')
		else:
			print('CHEFINA')
	elif od % 2 != 0:
		print('CHEF')
	else:
		print('CHEFINA')


def solution(f):
	odd = 0
	two = 0
	one = 0
	s = 0
	p = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for i in f:
		if i == 1:
			one += 1
		else:
			if i == 2:
				two += 1
			s += i
			p += 1
			if i % 2 == 1:
				odd += 1
	if one == 1:
		if not odd % 2 == 1:
			return CHEF
		if two == 0:
			return CHEFINA
		s -= 2
		p -= 1
		if (s - p) % 2 == 1:
			return CHEFINA
		else:
			return CHEF
	if one > 1:
		if (s - p) % 2 == 1:
			return CHEF
		else:
			return CHEFINA
	if odd % 2 == 1:
		return CHEF
	else:
		return CHEFINA
	raise Exception('smile')
t = int(input())
while t > 0:
	input()
	print(solution([int(i) for i in input().split()]))
	t -= 1


def getwin(piles):
	oddpile = 0
	twopile = 0
	onepile = 0
	sumpile = 0
	pile = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for nostones in piles:
		if nostones == 1:
			onepile += 1
		else:
			if nostones == 2:
				twopile += 1
			sumpile += nostones
			pile += 1
			if nostones & 1:
				oddpile += 1
	if onepile == 1:
		if not oddpile & 1:
			return CHEF
		if twopile == 0:
			return CHEFINA
		sumpile -= 2
		pile -= 1
		if sumpile - pile & 1:
			return CHEFINA
		else:
			return CHEF
	if onepile > 1:
		if sumpile - pile & 1:
			return CHEF
		else:
			return CHEFINA
	if oddpile & 1:
		return CHEF
	else:
		return CHEFINA
	raise Exception('LOL')
t = int(input())
while t > 0:
	input()
	print(getwin([int(i) for i in input().split()]))
	t -= 1


from sys import stdin

def input():
	return stdin.readline().rstrip('\r\n')
t = int(input())
for x in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	set1 = set(a)
	count1 = a.count(1)
	sum1 = sum(a)
	ans1 = sum1 - n
	if count1 >= 2:
		if ans1 % 2 == 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif count1 < 1:
		ans1 = sum1 - 2 * n
		if ans1 % 2:
			print('CHEF')
		else:
			print('CHEFINA')
	else:
		count2 = 0
		for l in a:
			if l != 1 and l % 2:
				count2 += 1
		if count2 % 2 == 0:
			print('CHEF')
		elif 2 in set1:
			if (sum1 - n) % 2:
				print('CHEF')
			else:
				print('CHEFINA')
		else:
			print('CHEFINA')


def soluion(piles):
	(oddpiles, onepiles, twopiles, sumpiles, pilesExcept) = (0, 0, 0, 0, 0)
	for noStones in piles:
		if noStones == 1:
			onepiles += 1
		else:
			if noStones == 2:
				twopiles += 1
			sumpiles += noStones
			pilesExcept += 1
			if noStones & 1:
				oddpiles += 1
	if onepiles == 1:
		if not oddpiles & 1:
			return 'CHEF'
		if twopiles == 0:
			return 'CHEFINA'
		sumpiles -= 2
		pilesExcept -= 1
		if sumpiles - pilesExcept & 1:
			return 'CHEFINA'
		else:
			return 'CHEF'
	if onepiles > 1:
		if sumpiles - pilesExcept & 1:
			return 'CHEF'
		else:
			return 'CHEFINA'
	if oddpiles & 1:
		return 'CHEF'
	else:
		return 'CHEFINA'
tc = int(input())
while tc != 0:
	n = int(input())
	print(soluion([int(i) for i in input().split()]))
	tc -= 1


def getWinn(piles):
	oddPilesCountExcepn = 0
	twoPilesCount = 0
	onePilesCount = 0
	sumPilesExcept1 = 0
	pilesExcept1 = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for noStones in piles:
		if noStones == 1:
			onePilesCount += 1
		else:
			if noStones == 2:
				twoPilesCount += 1
			sumPilesExcept1 += noStones
			pilesExcept1 += 1
			if noStones & 1:
				oddPilesCountExcepn += 1
	if onePilesCount == 1:
		if not oddPilesCountExcepn & 1:
			return CHEF
		if twoPilesCount == 0:
			return CHEFINA
		sumPilesExcept1 -= 2
		pilesExcept1 -= 1
		if sumPilesExcept1 - pilesExcept1 & 1:
			return CHEFINA
		else:
			return CHEF
	if onePilesCount > 1:
		if sumPilesExcept1 - pilesExcept1 & 1:
			return CHEF
		else:
			return CHEFINA
	if oddPilesCountExcepn & 1:
		return CHEF
	else:
		return CHEFINA
	raise Exception('lolfun')
t = int(input())
while t > 0:
	input()
	print(getWinn([int(i) for i in input().split()]))
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	j = 0
	k = 0
	l = 0
	m = 0
	n = 0
	for i in a:
		if i == 1:
			l += 1
		else:
			if i == 2:
				k += 1
			m += i
			n += 1
			if i % 2:
				j += 1
	if l == 1:
		if j % 2 == 0:
			print('CHEF')
			continue
		if k == 0:
			print('CHEFINA')
			continue
		m -= 2
		n -= 1
		if (m - n) % 2:
			print('CHEFINA')
			continue
		else:
			print('CHEF')
			continue
	if l > 1:
		if (m - n) % 2:
			print('CHEF')
			continue
		else:
			print('CHEFINA')
			continue
	if j % 2:
		print('CHEF')
		continue
	else:
		print('CHEFINA')
		continue


def Winner(piles):
	oddPilesCountExcep = 0
	twoPilesCount = 0
	onePilesCount = 0
	sumPilesExcept = 0
	pilesExcept = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for no_Stones in piles:
		if no_Stones == 1:
			onePilesCount += 1
		else:
			if no_Stones == 2:
				twoPilesCount += 1
			sumPilesExcept += no_Stones
			pilesExcept += 1
			if no_Stones & 1:
				oddPilesCountExcep += 1
	if onePilesCount == 1:
		if not oddPilesCountExcep & 1:
			return CHEF
		if twoPilesCount == 0:
			return CHEFINA
		sumPilesExcept -= 2
		pilesExcept -= 1
		if sumPilesExcept - pilesExcept & 1:
			return CHEFINA
		else:
			return CHEF
	if onePilesCount > 1:
		if sumPilesExcept - pilesExcept & 1:
			return CHEF
		else:
			return CHEFINA
	if oddPilesCountExcep & 1:
		return CHEF
	else:
		return CHEFINA
	raise Exception('lol')
test_case = int(input())
while test_case > 0:
	input()
	print(Winner([int(i) for i in input().split()]))
	test_case -= 1


def getWin(piles):
	oddpilescountexp1 = 0
	twopilescount = 0
	onepilescount = 0
	sumpilesexp1 = 0
	pilesexp1 = 0
	chef = 'CHEF'
	chefina = 'CHEFINA'
	for noStones in piles:
		if noStones == 1:
			onepilescount += 1
		else:
			if noStones == 2:
				twopilescount += 1
			sumpilesexp1 += noStones
			pilesexp1 += 1
			if noStones & 1:
				oddpilescountexp1 += 1
	if onepilescount == 1:
		if not oddpilescountexp1 & 1:
			return chef
		if twopilescount == 0:
			return chefina
		sumpilesexp1 -= 2
		pilesexp1 -= 1
		if sumpilesexp1 - pilesexp1 & 1:
			return chefina
		else:
			return chef
	if onepilescount > 1:
		if sumpilesexp1 - pilesexp1 & 1:
			return chef
		else:
			return chefina
	if oddpilescountexp1 & 1:
		return chef
	else:
		return chefina
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print(getWin(arr))


def getWinner(piles):
	oddPilesCountExcep1 = 0
	twoPilesCount = 0
	onePilesCount = 0
	sumPilesExcep1 = 0
	pilesExcep1 = 0
	chef = 'CHEF'
	chefina = 'CHEFINA'
	for noStones in piles:
		if noStones == 1:
			onePilesCount += 1
		else:
			if noStones == 2:
				twoPilesCount += 1
			sumPilesExcep1 += noStones
			pilesExcep1 += 1
			if noStones & 1:
				oddPilesCountExcep1 += 1
	if onePilesCount == 1:
		if not oddPilesCountExcep1 & 1:
			return chef
		if twoPilesCount == 0:
			return chefina
		sumPilesExcep1 -= 1
		if sumPilesExcep1 - pilesExcep1 & 1:
			return chefina
		else:
			return chef
	if onePilesCount > 1:
		if sumPilesExcep1 - pilesExcep1 & 1:
			return chef
		else:
			return chefina
	if oddPilesCountExcep1 & 1:
		return chef
	else:
		return chefina
t = int(input())
while t > 0:
	input()
	print(getWinner([int(i) for i in input().split()]))
	t -= 1


def getWinner(piles):
	piles_odd = 0
	piles_two = 0
	piles_one = 0
	piles_sum = 0
	piles_Without1 = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for Stones_less in piles:
		if Stones_less == 1:
			piles_one += 1
		else:
			if Stones_less == 2:
				piles_two += 1
			piles_sum += Stones_less
			piles_Without1 += 1
			if Stones_less & 1:
				piles_odd += 1
	if piles_one == 1:
		if not piles_odd & 1:
			return CHEF
		if piles_two == 0:
			return CHEFINA
		piles_sum -= 2
		piles_Without1 -= 1
		if piles_sum - piles_Without1 & 1:
			return CHEFINA
		else:
			return CHEF
	if piles_one > 1:
		if piles_sum - piles_Without1 & 1:
			return CHEF
		else:
			return CHEFINA
	if piles_odd & 1:
		return CHEF
	else:
		return CHEFINA
	raise Exception('lol')
t = int(input())
while t > 0:
	input()
	print(getWinner([int(i) for i in input().split()]))
	t -= 1


def sol(b, c, d, e, f):
	if d == 1:
		if not b & 1:
			return 'CHEF'
		if not c:
			return 'CHEFINA'
		if e - f - 3 & 1:
			return 'CHEFINA'
		return 'CHEF'
	elif d > 1:
		if e - f & 1:
			return 'CHEF'
		return 'CHEFINA'
	if b & 1:
		return 'CHEF'
	return 'CHEFINA'
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = c = d = e = f = 0
	for i in a:
		if i == 1:
			d += 1
		else:
			if i == 2:
				c += 1
			e += i
			f += 1
			if i & 1:
				b += 1
	print(sol(b, c, d, e, f))


def getWinner(piles):
	oddPilesCountExcep1 = 0
	twoPilesCount = 0
	onePilesCount = 0
	sumPilesExcept1 = 0
	pilesExcept1 = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for noStones in piles:
		if noStones == 1:
			onePilesCount += 1
		else:
			if noStones == 2:
				twoPilesCount += 1
			sumPilesExcept1 += noStones
			pilesExcept1 += 1
			if noStones & 1:
				oddPilesCountExcep1 += 1
	if onePilesCount == 1:
		if not oddPilesCountExcep1 & 1:
			return CHEF
		if twoPilesCount == 0:
			return CHEFINA
		sumPilesExcept1 -= 2
		pilesExcept1 -= 1
		if sumPilesExcept1 - pilesExcept1 & 1:
			return CHEFINA
		else:
			return CHEF
	if onePilesCount > 1:
		if sumPilesExcept1 - pilesExcept1 & 1:
			return CHEF
		else:
			return CHEFINA
	if oddPilesCountExcep1 & 1:
		return CHEF
	else:
		return CHEFINA
tew = int(input())
for w in range(tew):
	input()
	print(getWinner([int(i) for i in input().split()]))


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	(u, v, w, x, y) = (0, 0, 0, 0, 0)
	for i in range(len(arr)):
		if arr[i] == 1:
			w = w + 1
		else:
			if arr[i] == 2:
				v = v + 1
			if arr[i] % 2:
				u = u + 1
			x = x + arr[i]
			y = y + 1
	if w == 1:
		if not u % 2:
			print('CHEF')
			continue
		if v == 0:
			print('CHEFINA')
			continue
		x = x - 2
		y = y - 1
		if (x - y) % 2:
			print('CHEFINA')
			continue
		else:
			print('CHEF')
			continue
	elif w > 1:
		if (x - y) % 2:
			print('CHEF')
			continue
		else:
			print('CHEFINA')
			continue
	if u % 2:
		print('CHEF')
		continue
	else:
		print('CHEFINA')
		continue


def getWinner(piles):
	(odd, two, one, sumPiles1, pile1) = (0, 0, 0, 0, 0)
	for k in piles:
		if k == 1:
			one += 1
		else:
			if k == 2:
				two += 1
			sumPiles1 += k
			pile1 += 1
			if k & 1:
				odd += 1
	if one == 1:
		if not odd & 1:
			return 'CHEF'
		if two == 0:
			return 'CHEFINA'
		sumPiles1 -= 2
		pile1 -= 1
		if sumPiles1 - pile1 & 1:
			return 'CHEFINA'
		else:
			return 'CHEF'
	if one > 1:
		if sumPiles1 - pile1 & 1:
			return 'CHEF'
		else:
			return 'CHEFINA'
	if odd & 1:
		return 'CHEF'
	else:
		return 'CHEFINA'
t = int(input())
for i in range(t):
	input()
	piles = list(map(int, input().split()))
	print(getWinner(piles))


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	(q, r, s, u, v) = (0, 0, 0, 0, 0)
	for i in range(n):
		if arr[i] == 1:
			s += 1
		else:
			if arr[i] == 2:
				r += 1
			u += arr[i]
			v += 1
			if arr[i] % 2 != 0:
				q += 1
	if s == 1:
		if q % 2 == 0:
			print('CHEF')
			continue
		if r == 0:
			print('CHEFINA')
			continue
		u -= 2
		v -= 1
		if (u - v) % 2 != 0:
			print('CHEFINA')
			continue
		else:
			print('CHEF')
			continue
	elif s > 1:
		if (u - v) % 2 != 0:
			print('CHEF')
			continue
		else:
			print('CHEFINA')
			continue
	if q % 2 != 0:
		print('CHEF')
		continue
	else:
		print('CHEFINA')
		continue


def winneris(piles):
	oddpilescount1_Madhur = 0
	Twopiles_Madhur = 0
	onepile_Madhur = 0
	sumpile_Madhur = 0
	pileexcept1_Madhur = 0
	for noS in piles:
		if noS == 1:
			onepile_Madhur += 1
		else:
			if noS == 2:
				Twopiles_Madhur += 1
			sumpile_Madhur += noS
			pileexcept1_Madhur += 1
			if noS & 1:
				oddpilescount1_Madhur += 1
	if onepile_Madhur == 1:
		if not oddpilescount1_Madhur & 1:
			return print('CHEF')
		if Twopiles_Madhur == 0:
			return print('CHEFINA')
		sumpile_Madhur -= 2
		pileexcept1_Madhur -= 1
		if sumpile_Madhur - pileexcept1_Madhur & 1:
			return print('CHEFINA')
		else:
			return print('CHEF')
	if onepile_Madhur > 1:
		if sumpile_Madhur - pileexcept1_Madhur & 1:
			return print('CHEF')
		else:
			return print('CHEFINA')
	if oddpilescount1_Madhur & 1:
		return print('CHEF')
	else:
		return print('CHEFINA')
		raise Exception('lol')
t = int(input())
for test in range(t):
	n = int(input())
	arr = [int(char) for char in input().split()]
	winneris(arr)


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	a = list(map(int, input().split()))
	c1 = a.count(1)
	c2 = a.count(2)
	sumW1 = sum(a) - c1
	cW1 = len(a) - c1
	even = 0
	for i in a:
		if i % 2 != 0:
			even += 1
	if c1 == 1:
		if even % 2 != 0:
			print('CHEF')
			continue
		if c2 == 0:
			print('CHEFINA')
			continue
		sumW1 -= 2
		cW1 -= 1
		if (sumW1 - cW1) % 2 != 0:
			print('CHEFINA')
			continue
		else:
			print('CHEF')
			continue
	elif c1 > 1:
		if (sumW1 - cW1) % 2 != 0:
			print('CHEF')
			continue
		else:
			print('CHEFINA')
			continue
	if even % 2 != 0:
		print('CHEF')
		continue
	else:
		print('CHEFINA')
		continue


t = int(input())
while t > 0:
	n = int(input())
	a = list(map(int, input().split()))
	c1 = a.count(1)
	c2 = a.count(2)
	c_non1 = n - c1
	codd = 0
	s = sum(a) - c1
	flag = 0
	for i in range(n):
		if a[i] % 2 == 1 and a[i] != 1:
			codd += 1
	if c1 == 1:
		if codd % 2 == 0:
			print('CHEF')
			flag = 1
		if c2 == 0 and flag == 0:
			print('CHEFINA')
			flag = 1
		if (s - c_non1 - 1) % 2 == 1 and flag == 0:
			print('CHEFINA')
			flag = 1
		elif flag == 0:
			print('CHEF')
			flag = 1
	elif c1 > 1 and flag == 0:
		if (s - c_non1 - 1) % 2 == 1:
			flag = 1
			print('CHEFINA')
		else:
			print('CHEF')
			flag = 1
	if codd % 2 == 1 and flag == 0:
		print('CHEF')
	elif flag == 0:
		print('CHEFINA')
	t -= 1


import math
for T in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	(u, v, w, x, y) = (0, 0, 0, 0, 0)
	for i in range(0, n):
		if a[i] == 1:
			w += 1
		else:
			if a[i] == 2:
				v += 1
			x += a[i]
			y += 1
			if a[i] % 2:
				u += 1
	if w == 1:
		if not u % 2:
			print('CHEF')
			continue
		if v == 0:
			print('CHEFINA')
			continue
		x -= 2
		y -= 1
		if (x - y) % 2:
			print('CHEFINA')
			continue
		else:
			print('CHEF')
			continue
	elif w > 1:
		if (x - y) % 2:
			print('CHEF')
			continue
		else:
			print('CHEFINA')
			continue
	if u % 2:
		print('CHEF')
		continue
	else:
		print('CHEFINA')
		continue


def getwinner(piles):
	oddpileexp1 = 0
	twopilecount = 0
	onepilecount = 0
	sumpileexp1 = 0
	pileexp1 = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for noStones in piles:
		if noStones == 1:
			onepilecount += 1
		else:
			if noStones == 2:
				twopilecount += 1
			sumpileexp1 += noStones
			pileexp1 += 1
			if noStones & 1:
				oddpileexp1 += 1
	if onepilecount == 1:
		if not oddpileexp1 & 1:
			return CHEF
		if twopilecount == 0:
			return CHEFINA
		sumpileexp1 -= 2
		pileexp1 -= 1
		if sumpileexp1 - pileexp1 & 1:
			return CHEFINA
		else:
			return CHEF
	if onepilecount > 1:
		if sumpileexp1 - pileexp1 & 1:
			return CHEF
		else:
			return CHEFINA
	if oddpileexp1 & 1:
		return CHEF
	else:
		return CHEFINA
	raise Exception('lol')
t = int(input())
while t > 0:
	input()
	print(getwinner([int(i) for i in input().split()]))
	t -= 1


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = [0] * 5
	for i in a:
		if i == 1:
			b[0] += 1
		else:
			if i == 2:
				b[1] += 1
			b[2] += i
			b[3] += 1
			if i % 2:
				b[4] += 1
	if b[0] == 1:
		if b[4] % 2 == 0:
			print('CHEF')
			continue
		if b[1] == 0:
			print('CHEFINA')
			continue
		b[2] -= 2
		b[3] -= 1
		if (b[2] - b[3]) % 2:
			print('CHEFINA')
			continue
		else:
			print('CHEF')
			continue
	elif b[0] > 1:
		if (b[2] - b[3]) % 2:
			print('CHEF')
			continue
		else:
			print('CHEFINA')
			continue
	if b[4] % 2:
		print('CHEF')
	else:
		print('CHEFINA')


def gw(piles):
	ope1 = 0
	tp = 0
	op = 0
	spe1 = 0
	pe1 = 0
	CHEF = 'CHEF'
	CHEFINA = 'CHEFINA'
	for nostones in piles:
		if nostones == 1:
			op += 1
		else:
			if nostones == 2:
				tp += 1
			spe1 += nostones
			pe1 += 1
			if nostones & 1:
				ope1 += 1
	if op == 1:
		if not ope1 & 1:
			return CHEF
		if tp == 0:
			return CHEFINA
		spe1 -= 2
		pe1 -= 1
		if spe1 - pe1 & 1:
			return CHEFINA
		else:
			return CHEF
	if op > 1:
		if spe1 - pe1 & 1:
			return CHEF
		else:
			return CHEFINA
	if ope1 & 1:
		return CHEF
	else:
		return CHEFINA
	raise Exception
t = int(input())
while t > 0:
	input()
	print(gw([int(i) for i in input().split()]))
	t -= 1


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	stones = sum(a)
	lone_piles = a.count(1)
	if lone_piles > 1:
		if (stones - n) % 2 == 1:
			print('CHEF')
		else:
			print('CHEFINA')
	elif lone_piles == 1:
		if stones % 2 == 1 or (a.count(2) > 0 and (stones - n) % 2 == 1):
			print('CHEF')
		else:
			print('CHEFINA')
	elif stones % 2 == 1 and (stones - n) % 2 == 1:
		print('CHEF')
	elif stones % 2 == 0 and (stones - n) % 2 == 0:
		print('CHEFINA')
	elif stones % 2 == 1:
		print('CHEF')
	else:
		print('CHEFINA')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	u = v = w = x = y = 0
	for piles in l:
		if piles == 1:
			w += 1
		else:
			if piles == 2:
				v += 1
			x += piles
			y += 1
			if piles % 2:
				u += 1
	if w == 1:
		if not u % 2:
			print('CHEF')
			continue
		if v == 0:
			print('CHEFINA')
			continue
		x -= 2
		y -= 1
		if (x - y) % 2:
			print('CHEFINA')
			continue
		else:
			print('CHEF')
			continue
	elif w > 1:
		if (x - y) % 2:
			print('CHEF')
			continue
		else:
			print('CHEFINA')
			continue
	if u % 2:
		print('CHEF')
		continue
	else:
		print('CHEFINA')


t = int(input())

def check(a, b, c, d, e, f):
	if d == 1:
		if b % 2 == 0:
			print('CHEF')
			return
		if c == 0:
			print('CHEFINA')
			return
		e -= 2
		f -= 1
		if (e - f) % 2 == 0:
			print('CHEF')
			return
		else:
			print('CHEFINA')
			return
	elif d > 1:
		if (e - f) % 2 != 0:
			print('CHEF')
			return
		else:
			print('CHEFINA')
			return
	elif b % 2 != 0:
		print('CHEF')
		return
	else:
		print('CHEFINA')
		return
while t > 0:
	n = int(input())
	pile = [int(i) for i in input().split(' ')]
	odd_piles = 0
	count_2s = 0
	count_1s = 0
	totalStones = 0
	for i in pile:
		if i == 1:
			count_1s += 1
		else:
			if i == 2:
				count_2s += 1
			totalStones += i
			if i % 2 != 0:
				odd_piles += 1
	check(pile, odd_piles, count_2s, count_1s, totalStones, n - count_1s)
	t -= 1


def merge(arr, l, m, r):
	n1 = m - l + 1
	n2 = r - m
	L = [0] * n1
	R = [0] * n2
	for i in range(0, n1):
		L[i] = arr[l + i]
	for j in range(0, n2):
		R[j] = arr[m + 1 + j]
	i = 0
	j = 0
	k = l
	while i < n1 and j < n2:
		if L[i] <= R[j]:
			arr[k] = L[i]
			i += 1
		else:
			arr[k] = R[j]
			j += 1
		k += 1
	while i < n1:
		arr[k] = L[i]
		i += 1
		k += 1
	while j < n2:
		arr[k] = R[j]
		j += 1
		k += 1

def mergeSort(arr, l, r):
	if l < r:
		m = l + (r - l) // 2
		mergeSort(arr, l, m)
		mergeSort(arr, m + 1, r)
		merge(arr, l, m, r)

def greet(name):
	print(name)

def solution_time_limit_sepahlekardo():
	new_int = int(input())
	array_of_my_heart = list(map(int, input().split()))
	bravo = 0
	chumtiya = 0
	dudu = 0
	enhace = 0
	fucj = 0
	for i in range(new_int):
		if array_of_my_heart[i] == 1:
			dudu += 1
		else:
			if array_of_my_heart[i] == 2:
				chumtiya += 1
			enhace = enhace + array_of_my_heart[i]
			fucj += 1
			if array_of_my_heart[i] % 2 != 0:
				bravo += 1
	if dudu == 1:
		enhace -= 2
		fucj -= 1
		if bravo % 2 == 0:
			print('CHEF')
		elif chumtiya == 0:
			print('CHEFINA')
		elif (enhace - fucj) % 2 != 0:
			print('CHEFINA')
		else:
			print('CHEF')
	elif dudu > 1:
		if (enhace - fucj) % 2 != 0:
			print('CHEF')
		else:
			print('CHEFINA')
	elif bravo % 2 != 0:
		print('CHEF')
	else:
		print('CHEFINA')
test_case = int(input())
for i in range(test_case):
	solution_time_limit_sepahlekardo()