#include <bits/stdc++.h>
using namespace std;
long long k, z, o, p;
int main() {
  int n;
  cin >> n;
  string s, u;
  cin >> s;
  for (int i = 1; i <= n; i++) {
    string h;
    cin >> h;
    if (i == n) {
      for (int j = 5; j <= 7; j++) {
        u += h[j];
      }
    }
  }
  if (n % 2 == 0) {
    cout << "home" << endl;
  } else {
    cout << "contest" << endl;
  }
}
