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.io.*;
import java.util.*;

public final class Main {
    static char[] chars = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
    static char[] chars1 = {'#', '*', '&'};
    static char[] chars2 = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'};

    static boolean oneColor = true;

    // x1<0
    // x1+k*2>0;
    // k*2>-x1;
    // k=-x1/2
    public void solve() {
        int n = in.nextInt();
        if (n% 2 ==0){
            out.println("home");
        }else {
            out.println("contest");
        }
    }

    static class Library {
        static boolean isPrime(int a) {
            if (a == 1) {
                return false;
            }
            for (int i = 2; i * i <= a; i++) {
                if (a % i == 0)
                    return false;
            }
            return true;
        }

        static long bpow(long x, long n, long m) {
            long count = 1;
            if (n == 0) {
                return 1;
            }
            while (n > 0) {
                if ((n & 1) == 1) {
                    count *= x;
                    count %= m;
                }
                x *= x;
                x %= m;
                n >>= 1;
            }
            return count % m;
        }

        static long GCD(long a, long b) {
            if (b == 0) return a;
            return GCD(b, a % b);
        }

        static long lcm(long a, long b) {
            return (a * b) / Library.GCD(a, b);
        }
    }

    class Pair<X, Y> implements Comparable<Pair<X, Y>> {

        public X first;
        public Y second;

        public Pair(X first, Y second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public int hashCode() {
            int hash = 7;
            hash = 11 * hash + Objects.hashCode(this.first);
            hash = 11 * hash + Objects.hashCode(this.second);
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Pair<?, ?> other = (Pair<?, ?>) obj;
            if (!Objects.equals(this.first, other.first)) {
                return false;
            }
            if (!Objects.equals(this.second, other.second)) {
                return false;
            }
            return true;
        }

        @Override
        public int compareTo(Pair<X, Y> p) {
            return ((Comparable<X>) first).compareTo(p.first);
        }

        @Override
        public String toString() {
            return first + " " + second;
        }
    }

    class Node<E> {
        E element;
        Node<E> left;
        Node<E> right;
        Node<E> prev;

        Node(E element, Node left, Node right, Node prev) {
            this.element = element;
            this.left = left;
            this.right = right;
            this.prev = prev;
        }
    }

    //    -------------I/O-------------    \\
    private FScanner in;

    private PrintWriter out;

    public static void main(String[] args) {
        new Main().runIO();
    }


    void run() {
        try {
            in = new FScanner(new File("input.txt"));
            out = new PrintWriter(new BufferedWriter(new FileWriter(new File("output.txt"))));
            solve();
            out.close();
            in.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    void runIO() {
        in = new FScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        solve();
        out.close();
        in.close();
    }

    class FScanner {

        private BufferedReader br;
        private StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException ex) {
                ex.printStackTrace();
            }
        }

        void useString(String s) {
            if (s != null) {
                st = new StringTokenizer(s);
            }
        }

        void updateST() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        String next() {
            updateST();
            return st.nextToken();
        }

        Long[] nextLongArray() {
            updateST();
            LinkedList<Long> ll = new LinkedList<>();
            while (st.hasMoreElements()) {
                ll.add(Long.parseLong(st.nextToken()));
            }
            Long[] arr = new Long[1];
            return ll.toArray(arr);
        }

        Integer[] nextIntArray() {
            updateST();
            LinkedList<Integer> ll = new LinkedList<>();
            while (st.hasMoreElements()) {
                ll.add(Integer.parseInt(st.nextToken()));
            }
            Integer[] arr = new Integer[1];
            return ll.toArray(arr);
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            updateST();
            StringBuilder sb = new StringBuilder(st.nextToken());
            while (st.hasMoreElements()) {
                sb.append(st.nextToken());
            }
            return sb.toString();
        }

        void close() {
            try {
                br.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }

    }
}