#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, c = 0;
  cin >> n;
  string st, h, en;
  vector<string> s, t;
  char x, y;
  cin >> h;
  for (i = 0; i < n; i++) {
    cin >> st >> x >> y >> en;
    s.push_back(st);
    t.push_back(en);
  }
  if (n % 2 == 0)
    cout << "home"
         << "\n";
  else
    cout << "contest"
         << "\n";
}
