#include <bits/stdc++.h>
using namespace std;
int N, M, K;
string buf;
string mins;
bool stoRight;
bool conRight;
int conPos;
int main() {
  cin >> N >> M >> K;
  cin >> buf >> buf;
  if (buf == "head")
    conRight = false;
  else {
    assert(buf == "tail");
    conRight = true;
  }
  cin >> mins;
  conPos = K;
  stoRight = (M > K);
  if (conPos == N)
    conRight = false;
  else if (conPos == 1)
    conRight = true;
  for (int i = 0; i < mins.size(); ++i) {
    bool idle = (mins[i] == '1');
    if (idle) {
      if (conRight && conPos != 0) stoRight = false;
      if (!conRight && conPos == N)
        stoRight = false;
      else
        stoRight = true;
      stoRight = !conRight;
    }
    if (conRight)
      ++conPos;
    else
      --conPos;
    if ((conPos == N && stoRight) || (conPos == 1 && !stoRight)) {
      printf("Controller %d\n", i + 1);
      return 0;
    }
    if (conPos == N)
      conRight = false;
    else if (conPos == 1)
      conRight = true;
  }
  printf("Stowaway\n");
  return 0;
}
