There are literally dozens of snooker competitions held each year, and team Jinotega tries to attend them all (for some reason they prefer name "snookah")! When a competition takes place somewhere far from their hometown, Ivan, Artsem and Konstantin take a flight to the contest and back.

Jinotega's best friends, team Base have found a list of their itinerary receipts with information about departure and arrival airports. Now they wonder, where is Jinotega now: at home or at some competition far away? They know that:   this list contains all Jinotega's flights in this year (in arbitrary order),  Jinotega has only flown from his hometown to a snooker contest and back,  after each competition Jinotega flies back home (though they may attend a competition in one place several times),  and finally, at the beginning of the year Jinotega was at home. 

Please help them to determine Jinotega's location!


-----Input-----

In the first line of input there is a single integer n: the number of Jinotega's flights (1 ≤ n ≤ 100). In the second line there is a string of 3 capital Latin letters: the name of Jinotega's home airport. In the next n lines there is flight information, one flight per line, in form "XXX->YYY", where "XXX" is the name of departure airport "YYY" is the name of arrival airport. Exactly one of these airports is Jinotega's home airport.

It is guaranteed that flights information is consistent with the knowledge of Jinotega's friends, which is described in the main part of the statement.


-----Output-----

If Jinotega is now at home, print "home" (without quotes), otherwise print "contest".


-----Examples-----
Input
4
SVO
SVO->CDG
LHR->SVO
SVO->LHR
CDG->SVO

Output
home

Input
3
SVO
SVO->HKT
HKT->SVO
SVO->RAP

Output
contest



-----Note-----

In the first sample Jinotega might first fly from SVO to CDG and back, and then from SVO to LHR and back, so now they should be at home. In the second sample Jinotega must now be at RAP because a flight from RAP back to SVO is not on the list.

Difficulty: EASY

Solutions:
n = int(input())
s = input()
l = [input().split('->') for i in range(n)]
if n % 2 == 0:
	print('home')
else:
	print('contest')


a = int(input())
if a % 2:
	print('contest')
else:
	print('home')


from sys import stdin, stdout

def ri():
	return map(int, stdin.readline().split())
n = int(input())
for i in range(n + 1):
	s = input()
if n % 2:
	print('contest')
else:
	print('home')


n = int(input())
s = input()
(x, y) = (0, 0)
for i in range(n):
	w = input()
	a = w[:3]
	if a == s:
		x += 1
	else:
		y += 1
if x == y:
	print('home')
else:
	print('contest')


n = int(input())
home = input()
for _ in range(n):
	str = input()
if n % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input()) % 2
print('contest' if n else 'home')


n = int(input())
s = input()
for i in range(n):
	tmp = input()
print('home') if n & 1 == 0 else print('contest')


n = int(input())
h = input()
tl = [input() for _ in range(n)]
print('home' if n % 2 == 0 else 'contest')


x = int(input())
h = input()
c = 0
for i in range(x):
	n = input()
	if n[0] + n[1] + n[2] == h:
		c += 1
	else:
		c -= 1
if c == 0:
	print('home')
else:
	print('contest')


n = int(input())
home = input()
ans = 'contest'
flights = []
for i in range(n):
	s = input()
	sou = s[0:3]
	to = s[-3:]
	flight = (sou, to)
	rev = (to, sou)
	if rev in flights:
		flights.remove(rev)
	else:
		flights.append(flight)
if len(flights) == 0:
	ans = 'home'
print(ans)


n = int(input())
hm = input()
for i in range(n):
	fix = input()
if n % 2 == 0:
	print('home')
else:
	print('contest')


import re
import math
num = int(input())
input()
for i in range(num):
	input()
if num % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
s = input()
for i in range(n):
	m = input()
if n % 2 == 0:
	print('home')
else:
	print('contest')


no_flights = int(input())
home = input()
flights = [input().split('- >') for i in range(no_flights)]
if no_flights % 2 == 0:
	print('home')
else:
	print('contest')


print('contest' if int(input()) & 1 else 'home')


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
n = get_int()
s = get_string()
for i in range(n):
	get_string()
if n % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
t = n
home = input()
departure = []
while t > 0:
	flight = input()
	departure.append(flight[:3])
	t -= 1
if n % 2 == 0:
	print('home')
else:
	print('contest')


t = int(input())
s = input()
for _ in range(t):
	input()
print('home' if t % 2 == 0 else 'contest')


n = int(input())
text = input()
k = 0
for x in range(n):
	text1 = input()
	if text1[0:3] == text:
		k = k + 1
	else:
		k = k - 1
if k == 0:
	print('home')
else:
	print('contest')


a = int(input())
input()
for i in range(a):
	input()
if a % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
input()
for x in range(n):
	input()
if n % 2 == 0:
	print('home')
else:
	print('contest')


def main():
	print(('home', 'contest')[int(input()) & 1])
main()


n = int(input())
home = input()
cur = 0
for i in range(n):
	ticket = input()
	if home == ticket[:3]:
		cur += 1
if n - cur >= cur:
	print('home')
else:
	print('contest')


t = int(input())
if t % 2 == 0:
	print('home')
else:
	print('contest')


num = eval(input())
if num % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
s = input()
flights = []
for i in range(n):
	flights.append(input())
if n % 2 == 0:
	print('home')
else:
	print('contest')


import sys

def debug(x, table):
	for (name, val) in table.items():
		if x is val:
			print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
			return None

def solve():
	n = int(input())
	if n % 2 == 0:
		ans = 'home'
	else:
		ans = 'contest'
	print(ans)
solve()


n = int(input())
if n % 2 == 0:
	print('home')
	exit()
else:
	print('contest')
	exit()


F = int(input())
if F % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
home_airport = input()
itinerary = [input() for i in range(n)]
print('home') if n % 2 == 0 else print('contest')


3
n = int(input())
if n % 2 == 0:
	print('home')
else:
	print('contest')


t = int(input())
if t % 2 == 1:
	print('contest')
else:
	print('home')


a = int(input())
for x in range(a + 1):
	_n = input()
if a % 2:
	print('contest')
else:
	print('home')


n = int(input())
s = input()
go = 0
out = 0
for i in range(n):
	ss = input()
	if ss[:3] == s:
		go += 1
	if ss[-3:] == s:
		out += 1
if out == go:
	print('home')
else:
	print('contest')


n = int(input())
for i in range(n + 1):
	input()
if n % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
h = input()
if n % 2 == 0:
	print('home')
else:
	print('contest')


print('hcoomnet e s t'[int(input()) % 2::2])


print('home' if int(input()) % 2 is 0 else 'contest')


print(('home', 'contest')[int(input()) % 2])


n = int(input())
gorod = input()
k = 0
for i in range(n):
	polet = input()
	k = k + 1
if k % 2 == 0:
	print('home')
else:
	print('contest')


x = int(input())
a = input()
if x % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
home = input()
L = []
for i in range(n):
	L.append(input())
if n % 2 != 0:
	print('contest')
else:
	print('home')


def main_function():
	n = int(input())
	home = input()
	flights = [input() for i in range(n)]
	if not n % 2:
		return 'home'
	return 'contest'
print(main_function())


n = int(input())
home = input()
fl = ''
x = 0
for i in range(n):
	fl = input()
	if fl[-3:] == home:
		x += 1
if x == n / 2:
	print('home')
else:
	print('contest')


n = int(input())
code = input()
lines = []
for i in range(n):
	lines.append(input())
went = 0
came = 0
for line in lines:
	if line.startswith(code):
		went += 1
	else:
		came += 1
if went > came:
	print('contest')
else:
	print('home')


print('choonmtee s t'[1 - int(input()) % 2::2])


n = int(input())
a = {0: 'home', 1: 'contest'}
print(a[n % 2])


n = int(input())
home = input()
left_home = got_home = 0
for _ in range(n):
	s = input()
	if s[:len(home)] == home:
		left_home += 1
	if s[-len(home):] == home:
		got_home += 1
if left_home == got_home:
	print('home')
else:
	print('contest')


t = int(input())
s = input()
cnt1 = 0
cnt2 = 0
for i in range(t):
	s1 = input()
	p1 = s1[:3]
	p2 = s1[5:]
	if p1 == s:
		cnt1 = cnt1 + 1
	else:
		cnt2 = cnt2 + 1
if cnt1 == cnt2:
	print('home')
else:
	print('contest')


n = int(input())
home = input()
i = 0
lst = []
while i < n:
	lst.append(input())
	i += 1
j = cnt = cnt1 = 0
while j < len(lst):
	if lst[j][:3] == home:
		cnt += 1
	if lst[j][-3:] == home:
		cnt1 += 1
	j += 1
if cnt == cnt1:
	print('home')
else:
	print('contest')


__author__ = 'Ryabchun Vladimir'
flights = int(input())
home = input().strip()
for _ in range(flights):
	fl = input()
if flights % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
home = input()
cnt = 0
for _ in range(n):
	line = input()
	if line.startswith(home):
		cnt += 1
	elif line.endswith(home):
		cnt -= 1
if cnt == 0:
	print('home')
else:
	print('contest')


n = int(input())
home = input()
k = 0
for i in range(n):
	temp = input()
if n % 2 == 0:
	print('home')
else:
	print('contest')


def main():
	n = int(input())
	print('home' if not n % 2 else 'contest')
main()


n = int(input())
home = input()
for i in range(n - 1):
	s = input()
s1 = input().split('->')
if n % 2 == 0:
	print('home')
else:
	print('contest')


alph = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
h = str(input())
p = 0
for i in range(n):
	s = str(input())
	if s[0:3] == h:
		p += 1
	else:
		p -= 1
if p > 0:
	print('contest')
else:
	print('home')


n = int(input())
s = input()
for _ in range(n):
	s = input
print('contest' if n % 2 else 'home')


n = int(input())
for _ in range(n + 1):
	l = list(input())
if n % 2 == 0:
	print('home')
else:
	print('contest')


a = []
n = int(input())
if n % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
home = input()
ls = []
cnt = 0
for i in range(n):
	str1 = input()
	if str1.find(home) >= 0:
		cnt += 1
if cnt == n and cnt % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
z = input()
a = ''
for i in range(n):
	c = input()
	a += c
if n % 2 == 0:
	print('home')
else:
	print('contest')


l = []
a = int(input())
if a % 2 == 1:
	print('contest')
else:
	print('home')


n = int(input())
h = input()
for i in range(n):
	l = input()
if n % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
t = input()
gya = []
aya = []
for k in range(n):
	p = input()
	if p[:3] == t:
		gya.append(p[-3:])
	elif p[-3:] == t:
		aya.append(p[:3])
gya.sort()
aya.sort()
if gya == aya:
	print('home')
else:
	print('contest')


n = int(input())
home = input()
count = 0
for _ in range(n):
	s = input()
	count += -1 if s[0:3] == home else 1
print('home' if count == 0 else 'contest')


n = int(input())
h = str(input())
l = []
count = 0
for i in range(n):
	c = str(input())
	l.append(c)
if len(l) % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
home = input()
k = 0
for i in range(n):
	a = input()
	if home in a[-3:]:
		k += 1
if k == 0:
	print('contest')
elif n / k == 2:
	print('home')
else:
	print('contest')


IL = lambda : list(map(int, input().split()))
IS = lambda : input().split()
I = lambda : int(input())
S = lambda : input()
n = I()
home = S()
print('contest' if n % 2 else 'home')


number_of_flights = int(input())
output = 'contest' if number_of_flights % 2 else 'home'
for _ in range(number_of_flights + 1):
	input()
print(output)


n = int(input())
f = input()
h = [input() for i in range(n)]
print(['home', 'contest'][n % 2])


n = int(input())
home = input()
have = dict()
for _ in range(n):
	var = input()
	a = var[0:3]
	b = var[len(var) - 3:]
	if a in have:
		have[a] += 1
	else:
		have[a] = 1
	if b in have:
		have[b] += 1
	else:
		have[b] = 1
ans = 1
for (i, j) in have.items():
	if j & 1:
		ans = 0
if ans:
	print('home')
else:
	print('contest')


import math, sys, itertools
from decimal import *

def main():
	n = int(input())
	home = input()
	a = []
	for i in range(n):
		s = input()
	if n % 2 == 0:
		print('home')
	else:
		print('contest')
main()


n = int(input())
ht = input()
t = 0
for _ in range(n):
	l = input()
	if l[0:3] == ht:
		t -= 1
	else:
		t += 1
print(['home', 'contest'][t < 0])


n = int(input())
air = input()
con = 0
home = 0
for i in range(n):
	road = input()
	if road[0:3] == air:
		con += 1
	else:
		home += 1
if con > home:
	print('contest')
else:
	print('home')


def Neverending_competitions():
	n = int(input())
	home = input()
	for i in range(n):
		new = input()
	if n % 2 == 0:
		return 'home'
	else:
		return 'contest'
print(Neverending_competitions())


n = int(input())
home = str(input())
k = n
l = []
while n:
	l.append(str(input()))
	n -= 1
if k % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
r = input()
c = 0
for i in range(0, n):
	s = input()
if n % 2:
	print('contest')
else:
	print('home')


num = eval(input())
home = input()
startPlace = []
arrivePlace = []
for i in range(num):
	line = list(input())
	startPlace.append(''.join(line[0:3]))
	arrivePlace.append(''.join(line[5:9]))
if num % 2 == 0:
	print('home')
else:
	print('contest')


n = int(input())
if n & 1:
	print('contest')
	exit()
print('home')


n = int(input())
hl = input()
contest = 0
for _ in range(n):
	flight = input()
	x = flight.find(hl, 0, 3)
	if x == 0:
		contest -= 1
	else:
		contest += 1
if contest == 0:
	print('home')
else:
	print('contest')


from operator import itemgetter
n = int(input())
s = input()
for i in range(n):
	input()
ans = (n + 1) % 2
print('home' * ans + 'contest' * (1 - ans))


a = int(input())
temp = input()
for i in range(a):
	str = input()
print(['home', 'contest'][a % 2])


x = int(input())
for i in range(x + 1):
	y = input()
print(['home', 'contest'][x % 2])


n = int(input())
s = []
h = input()
for _ in range(n):
	s.append(input())
if n % 2 == 0:
	print('home')
else:
	print('contest')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7

def LI():
	return list(map(int, input().split()))

def II():
	return int(input())

def LS():
	return input().split()

def S():
	return input()

def main():
	n = II()
	if n % 2 == 0:
		return 'home'
	return 'contest'
print(main())