Problem: 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-&gt;CDG
LHR-&gt;SVO
SVO-&gt;LHR
CDG-&gt;SVO


Output

home


Input

3
SVO
SVO-&gt;HKT
HKT-&gt;SVO
SVO-&gt;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.

Solution (in JAVA):

Solution:
import java.util.*;
import java.io.*;
import java.math.*;
public class HackerEarth{
	static long mod=(long)Math.pow(10,9)+7;
	static final int lint=Integer.MAX_VALUE;
	static final double ldouble=Double.MAX_VALUE;
	public static void main(String args[]) {
        new Thread(null, new Runnable() {
            public void run() {
                try{
                    solve();
                }
                catch(Exception e){
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
	}
	/*//////////////////////////////////Code Starts here/////////////////////////////*/
	public static void solve(){
		InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int n=in.nextInt();
        String str=in.nextLine();
        for(int i=0;i<n;i++){
        	String s=in.nextLine();
        }
        if(n%2==0){
        	w.println("home");
        }
        else{
        	w.println("contest");
        }
        w.close();
	}
	/*//////////////////////////////////Code Ends here//////////////////////////////*/
//	static boolean T[][][];
//	static void subsetSum(int input[], int total, int count) {
//        T = new boolean[input.length + 1][total + 1][count+1];
//        for (int i = 0; i <= input.length; i++) {
//        	T[i][0][0] = true;
//        	for(int j = 1; j<=count; j++){
//        		T[i][0][j] = false;
//        	}
//        }
//        int sum[]=new int[input.length+1];
//        for(int i=1;i<=input.length;i++){
//            sum[i]=sum[i-1]+input[i-1];
//        }
//        for (int i = 1; i <= input.length; i++) {
//            for (int j = 1; j <= (int)Math.min(total,sum[i]); j++) {
//            	for (int k = 1; k <= (int)Math.min(i,count); k++){
//            		 if (j >= input[i - 1]) {//Exclude and Include
//                         T[i][j][k] = T[i - 1][j][k] || T[i - 1][j - input[i - 1]][k-1];
//                     } else {
//                         T[i][j][k] = T[i-1][j][k];
//                     }
//            	}
//            }
//        }
//    }
//	static <K,V extends Comparable<? super V>>
//	SortedSet<Map.Entry<K,V>> entriesSortedByValues(Map<K,V> map) {
//	    SortedSet<Map.Entry<K,V>> sortedEntries = new TreeSet<Map.Entry<K,V>>(
//	        new Comparator<Map.Entry<K,V>>() {
//	            @Override public int compare(Map.Entry<K,V> e1, Map.Entry<K,V> e2) {
//	                int res = e2.getValue().compareTo(e1.getValue());
//	                return res != 0 ? res : 1;
//	            }
//	        }
//	    );
//	    sortedEntries.addAll(map.entrySet());
//	    return sortedEntries;
//	}
	
	//static TreeMap<Integer,Integer> tm[];
//	static LinkedList<Integer> adj[]; //Adjacency Lists
//    static int V;   // No. of vertices
//    // Constructor
//    static void Graph(int v)
//    {
//        V = v;
//        adj = new LinkedList[v];
//      //  tm = new TreeMap[v];
//        for (int i=0; i<v; ++i){
//        //    tm[i] = new TreeMap<Integer,Integer>();
//        	adj[i] = new LinkedList();
//        }
//    }
// 
//    // Function to add an edge into the graph
//    static void addEdge(int v,int w)
//    {
//    	//tm[v].put(w, val);
//        adj[v].add(w);
//    }
//	
	//minimum prime factor of all the numbers less than n
//	static void minimumPrime(int n){
//		int minPrime[]=new int[n+1];
//        for (int i = 2; i * i <= n; ++i) {
//            if (minPrime[i] == 0) {         //If i is prime
//                for (int j = i * i; j <= n; j += i) {
//                    if (minPrime[j] == 0) {
//                        minPrime[j] = i;
//                    }
//                }
//            }
//        }
//        for (int i = 2; i <= n; ++i) {
//            if (minPrime[i] == 0) {
//                minPrime[i] = i;
//            }
//        }
//	}
	//for marking all prime numbers greater than 1 and less than equal to N
//	static int sieve(int N) {
//        boolean isPrime[]=new boolean[N+1];
//        for(int i = 0; i <= N;++i) {
//            isPrime[i] = true;
//        }
//        isPrime[0] = false;
//        isPrime[1] = false;
//        for(int i = 2; i * i <= N; ++i) {
//             if(isPrime[i] == true) {                    //Mark all the multiples of i as composite numbers
//                 for(int j = i * i; j <= N ;j += i)
//                     isPrime[j] = false;
//            }
//        }
//        int count=0;
//        for(int i=0;i<=N;i++){
//        	if(isPrime[i]==true){
//        		count++;
//        	}
//        }
//        return count;
//    }
// 
	static long power(long base, long exponent, long modulus){
	    long result = 1;
	    while (exponent > 0) {
	        if (exponent % 2 == 1)
	            result = (result * base) % modulus;
	        exponent = exponent >> 1;
	        base = (base * base) % modulus;
	    }
	    return result;
	}
	static long modInverse(long A, long M)
	{
		long x=extendedEuclid(A,M)[0];
		return (x%M+M)%M;    //x may be negative
	}
	static long[] extendedEuclid(long A, long B) {
		if(B == 0) {
			long d = A;
			long x = 1;
			long y = 0;
			return new long[]{x,y,d};
		}
		else {
			long arr[]=extendedEuclid(B, A%B);
			long temp = arr[0];
			arr[0] = arr[1];
			arr[1] = temp - (A/B)*arr[1];
			return arr;
		}
	}
//	static boolean isPrime(int n) {
//        if(n < 2) return false;
//        if(n == 2 || n == 3) return true;
//        if(n%2 == 0 || n%3 == 0) return false;	
//        int sqrtN = (int)Math.sqrt(n)+1;
//        for(int i = 6; i <= sqrtN; i += 6) {
//            if(n%(i-1) == 0 || n%(i+1) == 0) return false;
//        }
//        return true;
//    }
//	static long modpowIter(long a, long b) {
//        long ans=1;
//        while(b != 0) {
//                if(b%2==1)
//                	ans=(ans*a)%mod;
//                a=(a*a)%mod;
//                b=b>>1;
//        }
//        return ans;
//	}
	static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, numChars;
        private SpaceCharFilter filter;
 
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
        
        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }
 
        public String nextLine() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }
 
        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
 
        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
 
        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }
 
        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }
 
        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
 
        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
	}
} 
class Node{
	ArrayList<Integer> arr=new ArrayList<Integer>();
	public void set(){
		
	}
}