#include <bits/stdc++.h>
using namespace std;
inline void read(register int *n) {
  register char c;
  *n = 0;
  do {
    c = getchar();
  } while (c < '0' || c > '9');
  do {
    *n = c - '0' + *n * 10;
    c = getchar();
  } while (c >= '0' && c <= '9');
}
int n, m, k;
vector<int> pos;
int main() {
  cin >> n >> m >> k;
  m--;
  k--;
  for (register int i = (0); i < (int)(n - 1); ++i) pos.push_back(i);
  for (register int i = (0); i < (int)(n - 1); ++i) pos.push_back(n - 1 - i);
  string dir;
  cin >> dir >> dir;
  if (dir == "head") k = 2 * n - 2 - k;
  if (pos[k] < m)
    m = n - 1;
  else
    m = 0;
  string path;
  cin >> path;
  for (register int i = (0); i < (int)(((int)(path).size())); ++i) {
    if (path[i] == '1') {
      if (k < n - 1)
        m = 0;
      else
        m = n - 1;
    }
    k = (k + 1) % ((int)(pos).size());
    if (pos[k] == m) {
      cout << "Controller " << i + 1 << "\n";
      return 0;
    }
  }
  cout << "Stowaway"
       << "\n";
  return 0;
}
