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: competition

Starter code:

Solutions:
n = int(input())
if n % 2:
    print("contest")
else:
    print("home")

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

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

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

n = int(input())
base = str(input())

for _ in range(n):
    s = str(input())

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

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

from collections import defaultdict
n = int(input())

home = input()
d = defaultdict(int)

for i in range(n):
    s = input()
    fr, to = s.split('->')
    d[fr] -= 1
    d[to] += 1

if d[home] == 0:
    print('home')
else:
    print('contest')


n = int(input())

if n % 2:
    print("contest")
else:
    print("home")


n = int(input())
# input()
# for i in range(n):
# 	input()
if n % 2 == 0:
	print("home")
else:
	print("contest")

3
# Copyright (C) 2017 Sayutin Dmitry.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; version 3
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; If not, see <http://www.gnu.org/licenses/>.

import sys

def main():
    n = int(input())
    home = input().strip()

    cnt_fr, cnt_to = 0, 0
    for i in range(n):
        fr, to = input().strip().split('->')
        if fr == home:
            cnt_fr += 1
        if to == home:
            cnt_to += 1

    if cnt_fr == cnt_to + 1:
        print("contest")
    elif cnt_fr == cnt_to:
        print("home")
    else:
        return(1)
main()


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())
s = input()
ss = []
cnt = 0
for i in range(n):
    t = input()
    t = t.split('->')
    cnt += t[1] == s
    ss.append((t))
if(cnt == n//2 and n%2 == 0):
    print('home')
else:
    print('contest')

3

n = int(input())

if n % 2 == 0:
    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")

#!/usr/bin/env python3
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())

print("home" if n % 2 == 0 else "contest")



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


n = int(input())
places = set()
start = input()
places.add(start)
for i in range(n):
    for s in input().split("->"):
        if s in places:
            places.remove(s)
        else:
            places.add(s)
for place in places:
    if place == start:
        print("home")
    else:
        print("contest")



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

n = int(input())
s = input()
a = [input() for i in range(n)]
f = sum(s + "->" in i for i in a)
t = sum("->" + s in i for i in a)
if f == t:
	print("home")
else:
	print("contest")


def main():
    n = int(input())
    home_aprt = str(input())
    balance = 0
    for i in range(n):
        f, s = input().split('->')
        if f == home_aprt:
            balance += 1
        else:
            balance -= 1

    if balance == 0:
        print('home')
    else:
        print('contest')
main()

n = int(input())
s = input()

departures, arrivals = 0, 0

for _ in range(n):
    s1, s2 = input().split('->')
    if s1 == s:
        departures += 1
    if s2 == s:
        arrivals += 1

if departures != arrivals:
    print("contest")
else:
    print("home")


n = int(input())
h = input()
d = []
for _ in range(n):
	s = input()
	fr = s[:3]
	to = s[5:]
	if (to, fr) in d:
		del d[d.index((to, fr))]
	else:
		d.append((fr, to))
if len(d):
	print('contest')
else:
	print('home')

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")

n = int(input())
airp = input()
dep = []
arr = []
for i in range(n):
	t = input().split("->")
	dep.append(t[0])
	arr.append(t[1])

if n % 2 == 1:
	print("contest")
else:
	if dep.count(airp) == arr.count(airp):
		print("home")
	else:
		print("contest")