#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k;
  int N;
  int pS, pC;
  string t;
  string s, buf;
  int dir;
  getline(cin, buf);
  sscanf(buf.c_str(), "%d %d %d", &N, &pS, &pC);
  pS--;
  pC--;
  getline(cin, s);
  if (s == "to head")
    dir = -1;
  else
    dir = 1;
  cin >> t;
  int sz = t.size();
  bool Swin = true;
  for (i = 0; i < sz; i++) {
    if (pS == pC) {
      Swin = false;
      break;
    }
    if (t[i] == '0') {
      if (pS < pC && pS > 0) {
        pS--;
      } else if (pS > pC && pS < N - 1) {
        pS++;
      }
      if (pC == 0 && dir == -1)
        dir = 1;
      else if (pC == N - 1 && dir == 1)
        dir = -1;
      pC += dir;
    } else {
      if (pC == 0 && dir == -1)
        dir = 1;
      else if (pC == N - 1 && dir == 1)
        dir = -1;
      pC += dir;
      if (dir == 1) {
        if (pC == 0) {
          pS = N - 1;
        } else {
          pS = 0;
        }
      } else {
        if (pC == N - 1) {
          pS = 0;
        } else {
          pS = N - 1;
        }
      }
    }
  }
  if (Swin) {
    printf("Stowaway\n");
  } else {
    printf("Controller %d\n", i);
  }
  return 0;
}
