AtCoder Beginner Contest 089 - Hina Arare

In Japan, people make offerings called hina arare, colorful crackers, on March 3.
We have a bag that contains N hina arare. (From here, we call them arare.)
It is known that the bag either contains arare in three colors: pink, white and green, or contains arare in four colors: pink, white, green and yellow.
We have taken out the arare in the bag one by one, and the color of the i-th arare was S_i, where colors are represented as follows - pink: P, white: W, green: G, yellow: Y.
If the number of colors of the arare in the bag was three, print Three; if the number of colors was four, print Four.

-----Constraints-----
 - 1 \leq N \leq 100
 - S_i is P, W, G or Y.
 - There always exist i, j and k such that S_i=P, S_j=W and S_k=G.

-----Input-----
Input is given from Standard Input in the following format:
N
S_1 S_2 ... S_N

-----Output-----
If the number of colors of the arare in the bag was three, print Three; if the number of colors was four, print Four.

-----Sample Input-----
6
G W Y P Y W

-----Sample Output-----
Four

The bag contained arare in four colors, so you should print Four.

Difficulty: EASY

Starter code:

Solutions:
num = int(input())
colors = list(map(str, input().split()))
if colors.count('Y') > 0:
	print('Four')
else:
	print('Three')


N = int(input())
S = input()
print('Four' if 'Y' in S else 'Three')


N = int(input())
S = list(map(str, input().split()))
color = []
for i in S:
	if i in color:
		pass
	else:
		color.append(i)
if len(color) == 4:
	print('Four')
else:
	print('Three')


n = int(input())
s = set(input().split())
print('Four' if len(s) == 4 else 'Three')


snack_num = int(input())
a = list(map(str, input().split()))
color_set = set(a)
if len(color_set) == 3:
	print('Three')
else:
	print('Four')


(a, b) = open(0)
print(('Three', 'Four')['Y' in b])


input()
s = set(input().split())
print('Four' if len(s) == 4 else 'Three')


n = input()
print('Four' if len(set(map(str, input().split()))) == 4 else 'Three')


n = int(input())
list_s = [s for s in input().split()]
if 'P' in list_s and 'W' in list_s and ('G' in list_s) and ('Y' in list_s):
	print('Four')
else:
	print('Three')


def atc_089b(input_value: str) -> str:
	N = input_value[0]
	Si = input_value[1]
	colors = ['P' in Si, 'W' in Si, 'G' in Si, 'Y' in Si]
	if colors.count(True) == 3:
		return 'Three'
	elif colors.count(True) == 4:
		return 'Four'
	else:
		return 'other'
N_input = input()
Si_input = input()
print(atc_089b([N_input, Si_input]))


input()
print('TFhoruere'[input().split().count('Y') > 0::2])


N = int(input())
S = list(input().split())
print('Four' if 'Y' in S else 'Three')


input()
print('Four' if 'Y' in input() else 'Three')


i = open(0).read().split()[1:]
print(['Three', 'Four']['Y' in i])


input()
print(['Four', 'Three'][len(set(list(input().split()))) - 4])


N = int(input())
s = list(map(str, input().split()))
if 'Y' in s:
	print('Four')
else:
	print('Three')


a = int(input())
b = input().split()
print('Four' if 'Y' in b else 'Three')


input()
print('Four' if len({i for i in input().split()}) == 4 else 'Three')


N = int(input())
s = list(map(str, input().split()))
result = 'Three'
if s.count('Y') > 0:
	result = 'Four'
print(result)


n = int(input())
print('Four' if 'Y' in input() else 'Three')


n = int(input())
a = list(input().split())
if 'Y' in a:
	print('Four')
else:
	print('Three')


(n, s) = map(str, open(0))
print('Four' if 'Y' in s else 'Three')


(a, o) = open(0)
print('TFhoruere'['Y' in o::2])


input()
s = map(str, input().split())
print('Three' if len(set(s)) == 3 else 'Four')


N = int(input())
S = list(input().split())
if 'P' and 'W' and 'G' and ('Y' in S):
	print('Four')
else:
	print('Three')


input()
print('TFhoruere'['Y' in input()::2])


N = int(input())
my_list = list(input().split())
arare_list = ['P', 'W', 'G', 'Y']
my_list_only = set(my_list)
count = 0
for i in range(0, 4):
	if arare_list[i] in my_list_only:
		count += 1
if count == 3:
	answer = 'Three'
if count == 4:
	answer = 'Four'
print(answer)


def decision(pack: list) -> str:
	if 'Y' in pack:
		return 'Four'
	return 'Three'

def __starting_point():
	n = int(input())
	pack = list(map(str, input().split()))
	print(decision(pack))
__starting_point()


n = int(input())
S = set(input().split())
print('Three' if len(S) == 3 else 'Four')


n = int(input())
s = input().split()
print('Four' if 'Y' in s else 'Three')


N = int(input())
print('Three' if len(set(input().split())) == 3 else 'Four')


n = int(input())
lst = input().split()
print('Four' if 'Y' in lst else 'Three')


_ = input()
print(['Three', 'Four']['Y' in input()])


n = input()
print('Three') if len(set(input().split())) < 4 else print('Four')


def answer(n: str, s: str) -> str:
	return 'Three' if len(set(s.split())) == 3 else 'Four'

def main():
	n = input()
	s = input()
	print(answer(n, s))

def __starting_point():
	main()
__starting_point()


N = int(input())
print(['Three', 'Four']['Y' in input().split()])


input()
a = input().split()
print(['Three', 'Four']['Y' in a])


(N, *S) = open(0).read().split()
print('Four' if 'Y' in S else 'Three')


input()
print('Four' if len(list(set(input().split()))) == 4 else 'Three')


input()
S = set(input().split())
print('Three' if len(S) == 3 else 'Four')


(n, l) = open(0)
print('Four' if len(set(l.split())) == 4 else 'Three')


(n, a) = open(0)
print('TFhoruere'['Y' in a::2])


n = int(input())
s = input().split()
print('TFhoruere'['Y' in s::2])


n = int(input())
list01 = input().split()
if 'Y' in list01:
	print('Four')
else:
	print('Three')


n = int(input())
s = list(input())
Four = ['P', 'Y', 'G', 'W']
ml = all((word in s for word in Four))
if ml:
	print('Four', flush=True)
else:
	print('Three', flush=True)


_ = input()
print('Four' if 'Y' in input().strip() else 'Three')


n = input()
w = set(input().split())
print('Three' if len(w) == 3 else 'Four')


input()
a = input().split()
print('Four' if len(set(a)) == 4 else 'Three')


input()
print('TFhoruere'[len(set(input().split())) > 3::2])


N = int(input())
l = list(map(str, input().split()))
ln = len(set(l))
if ln == 3:
	print('Three')
else:
	print('Four')


input()
s = input().split()
print('Four' if 'Y' in s else 'Three')


print([0, 0, input(), 'Three', 'Four'][len(set(input().split()))])


n = input()
print(['Three', 'Four'][len(set(input().split())) - 3])


N = int(input())
S = input().split()
print('Three' if len(set(S)) & 1 else 'Four')


(N, S) = open(0)
print('TFhoruere'[len(set(S.split())) % 2 < 1::2])


n = int(input())
S = input().split()
print('Four' if 'Y' in S else 'Three')


offering_number = int(input())
offering_color = set((i for i in input().split()))
if len(offering_color) == 3:
	print('Three')
else:
	print('Four')


N = int(input())
(*S,) = input().split()
print('Four' * ('Y' in S) or 'Three')


n = int(input())
s = list(input().split())
print(('Three', 'Four')['Y' in s])


input()
print('Three' if len(set(list(input().split()))) == 3 else 'Four')


N = int(input())
S = map(str, input().split())
if 'Y' in S:
	print('Four')
else:
	print('Three')


input()
l = [i for i in input().split()]
print('Four' if 'Y' in l else 'Three')


n = int(input())
colors = list(map(str, input().split()))
if 'Y' in colors:
	print('Four')
else:
	print('Three')


_ = int(input())
s = input().split()
print('Four' if 'Y' in s else 'Three')


n = int(input())
l = input().split()
print('Four' if 'Y' in l else 'Three')


N = str(input())
S = map(str, input().split())
color = list(S)
factor = set(color)
if len(factor) == 3:
	print('Three')
if len(factor) == 4:
	print('Four')


n = input()
s = list(input().split())
print('TFhoruere'['Y' in s::2])


n = input()
s = list(map(str, input().split()))
if 'Y' not in s:
	print('Three')
else:
	print('Four')


N = int(input())
S = list(input().split())
cnt = len(set(S))
print('Three' if cnt == 3 else 'Four')


(n, *s) = open(0).read().split()
print('Four' if 'Y' in s else 'Three')


N = int(input())
S = str(input())

def ans089(N: int, S: list):
	S = S.split()
	if len(set(S)) == 4:
		return 'Four'
	elif len(set(S)) == 3:
		return 'Three'
print(ans089(N, S))


N = int(input())
S = set(input().split())
print(['Three', 'Four'][len(S) - 3])


(N, S) = open(0)
print('TFhoruere'['Y' in S.split()::2])


_ = input()
A = list(input())
print('Four' if 'Y' in A else 'Three')


n = int(input())
a = list(input().split())
if len(set(a)) == 3:
	print('Three')
else:
	print('Four')


def main():
	n = int(input())
	s = input()
	for c in s:
		if c == 'Y':
			print('Four')
			return
	print('Three')
main()


import collections
n = int(input())
li = list(input().split())
c = collections.Counter(li)
if len(c) == 3:
	print('Three')
else:
	print('Four')


import sys, collections
lines = [s.rstrip('\n') for s in sys.stdin.readlines()]
(n,) = [int(num) for num in lines.pop(0).split(' ')]
s_list = lines.pop(0).split(' ')
c = collections.Counter(s_list)
if len(c) == 3:
	print('Three')
elif len(c) == 4:
	print('Four')


(n, *s) = open(0).read().split()
print('TFhoruere'[len(set(s)) > 3::2])


n = int(input())
s = input()
print('Four' if len(set(s)) == 5 else 'Three')


input()
print('TFhoruere'[len(set(input())) > 4::2])


n = int(input())
s = list(map(str, input().split()))
import collections
s = collections.Counter(s)
if len(s.keys()) == 3:
	print('Three')
else:
	print('Four')


import sys
from io import StringIO
import unittest
from collections import Counter

class TestClass(unittest.TestCase):

	def assertIO(self, input, output):
		(stdout, stdin) = (sys.stdout, sys.stdin)
		(sys.stdout, sys.stdin) = (StringIO(), StringIO(input))
		resolve()
		sys.stdout.seek(0)
		out = sys.stdout.read()[:-1]
		(sys.stdout, sys.stdin) = (stdout, stdin)
		self.assertEqual(out, output)

	def test_入力例_1(self):
		input = '6\nG W Y P Y W'
		output = 'Four'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = '9\nG W W G P W P G G'
		output = 'Three'
		self.assertIO(input, output)

	def test_入力例_3(self):
		input = '8\nP Y W G Y W Y Y'
		output = 'Four'
		self.assertIO(input, output)

def resolve():
	N = int(input())
	S = list(input().split())
	C = Counter(S)
	if 'Y' in C:
		print('Four')
	else:
		print('Three')

def __starting_point():
	resolve()
__starting_point()


input()
color = input().split()
print('Four' if 'Y' in color else 'Three')


n = int(input())
s = set(input().split())
print(['Three', 'Four'][len(s) > 3])


N = int(input())
print(['Three', 'Four'][len(set(input().split())) == 4])


_ = int(input())
S = input().split()
print('Four' if 'Y' in S else 'Three')


_ = input()
S = set(input().split())
print('Four' if len(S) == 4 else 'Three')


S_list = [input() for i in range(2)]
N = map(int, S_list[0].split())
A_list = set(S_list[1].split())
four = {'P', 'W', 'G', 'Y'}
if len(A_list & four) == 3:
	result = 'Three'
else:
	result = 'Four'
print(result)


_ = input()
print('Three' if len(set(input().split())) == 3 else 'Four')


N = int(input())
s = set(input())
print('Four' if len(s) == 5 else 'Three')


N = int(input())
a = input().split()
print('Four' if 'Y' in a else 'Three')


(_, *s) = map(str, open(0).read().split())
print('TFhoruere'[len(set(s)) == 4::2])


n = input()
a = input().split()
print(('Three', 'Four')[len(set(a)) == 4])


n = int(input())
s = list(input().split())
P = s.count('P')
W = s.count('W')
G = s.count('G')
print('Three' if n == P + W + G else 'Four')


n = input()
S = str(input())
print('Four' if 'Y' in S else 'Three')


N = int(input())
color = list(map(str, input().split()))
pp = 0
wp = 0
gp = 0
yp = 0
for i in range(N):
	if color[i] == 'P' and pp == 0:
		pp += 1
	if color[i] == 'W' and wp == 0:
		wp += 1
	if color[i] == 'G' and gp == 0:
		gp += 1
	if color[i] == 'Y' and yp == 0:
		yp += 1
if pp + wp + gp + yp == 3:
	print('Three')
else:
	print('Four')


n = int(input())
a = [s for s in input().split()]
seta = set(a)
if len(seta) == 4:
	print('Four')
else:
	print('Three')


N = int(input())
S = list(input().split())
for c in S:
	if c == 'Y':
		print('Four')
		break
else:
	print('Three')


_ = input()
s = input()
ans = 'Four' if 'Y' in s else 'Three'
print(ans)


_ = int(input())
print('Four' if 'Y' in input() else 'Three')


print('TFhoruere'['Y' in open(0).read()::2])


_ = input()
s = input().split()
print('TFhoruere'['Y' in s::2])


N = int(input())
S = list(map(str, input().split()))
if len(set(S)) == 3:
	print('Three')
elif len(set(S)) == 4:
	print('Four')


N = input()
arare = list(map(str, input().split()))
if 'Y' in arare:
	print('Four')
else:
	print('Three')


N = input()
print(['Three', 'Four']['Y' in input()])


n = input()
print('Four' if len(set(input())) == 5 else 'Three')


input()
print('Four' if any(('Y' in s for s in input().split())) else 'Three')


n = int(input())
s = list(map(str, input().split()))
s = set(s)
if len(s) == 3:
	print('Three')
else:
	print('Four')


N = int(input())
print('Four' if len(set(input().split())) == 4 else 'Three')


print('TFhoruere'[len(set(open(0).read().split())) - 4::2])


_ = int(input())
print(['Three', 'Four']['Y' in input().split()])


n = input()
s = input()
if 'Y' in s:
	print('Four')
else:
	print('Three')


n = input()
s = input().split()
print('Three' if 'Y' not in s else 'Four')


N = int(input())
S = list(map(str, input().split()))
candy_list = ['P', 'W', 'G', 'Y']
answer = 0
for i in range(4):
	if candy_list[i] in S:
		answer += 1
if answer == 3:
	print('Three')
if answer == 4:
	print('Four')


def main():
	n = int(input())
	s = list(input().split())
	hina = ['P', 'W', 'G', 'Y']
	hina_type = 0
	for i in hina:
		if i in s:
			hina_type += 1
	if hina_type == 3:
		print('Three')
	if hina_type == 4:
		print('Four')

def __starting_point():
	main()
__starting_point()


n = int(input())
hina_arare = map(str, input().split())
if 'Y' in hina_arare:
	print('Four')
else:
	print('Three')


N = int(input())
C = list(map(str, input().split()))
if 'P' and 'W' and 'G' and ('Y' in C):
	print('Four')
else:
	print('Three')


N = int(input())
S = set(input().split(' '))
if len(S) == 3:
	print('Three')
elif len(S) == 4:
	print('Four')


n = int(input())
s = list(map(str, input().split()))
for i in s:
	if i == 'Y':
		print('Four')
		break
else:
	print('Three')


n = int(input())
print('TFhoruere'[input().split().count('Y') != 0::2])


n = int(input())
s = list(map(str, input().split()))
if s.count('Y') == 0:
	print('Three')
else:
	print('Four')


N = input()
S = set(input().split())
print('Four' if len(S) == 4 else 'Three')


n = input()
print('Four' if 'Y' in input().split() else 'Three')


input()
print(['Three', 'Four']['Y' in set(input().split())])


N = int(input())
arares = list(map(str, input().split()))
if len([arare for arare in set(arares) if arares.count(arare) > 0]) == 3:
	print('Three')
elif len([arare for arare in set(arares) if arares.count(arare) > 0]) == 4:
	print('Four')


a = int(input())
l = set(input().split())
if len(l) == 3:
	print('Three')
else:
	print('Four')


print([0, 1, 2, 'Three', 'Four'][0 * int(input()) + len(set(input().split()))])


i = input()
Si = input()
if 'Y' in Si:
	print('Four')
else:
	print('Three')


N = int(input())
s = list(input().split())

def answer(N: int, s: str) -> str:
	if 'Y' in s:
		return 'Four'
	else:
		return 'Three'
print(answer(N, s))


n = int(input())
print('Four' if 'Y' in set(input().split()) else 'Three')


n = int(input())
print('TFhoruere'[len(set(list(input().split()))) == 4::2])


_ = input()
s = set(input().split())
print('TFhoruere'[len(s) == 4::2])


(n, s) = [input() for _ in range(2)]
print('Four' if 'Y' in s else 'Three')


input()
l = input().split()
print('Four' if 'Y' in l else 'Three')


n = int(input())
s = list(input())
print('Four' if 'Y' in s else 'Three')