#include <bits/stdc++.h>
using namespace std;
int nLen;
int S, C;
bool head = true;
string timeLine;
inline void read() {
  scanf("%d", &nLen);
  scanf("%d", &S);
  scanf("%d", &C);
  --S;
  --C;
  string a1, a2;
  cin >> a1 >> a2;
  if (a2 == "tail") head = false;
  cin >> timeLine;
}
inline int givePos(int X) {
  int nwIndx = X;
  if (head) {
    nwIndx--;
    if (nwIndx < 0) {
      head = false;
      nwIndx = 1;
    }
  } else {
    nwIndx++;
    if (nwIndx >= nLen) {
      head = true;
      nwIndx = nLen - 2;
    }
  }
  return nwIndx;
}
inline int decision(int nwPos, int fuPos, int &myPos, char status) {
  if (status == '0') {
    if (fuPos == myPos) {
      if (myPos == 0 || myPos + 1 == nLen) {
        return -1;
      } else {
        if (head) {
          myPos--;
        } else {
          myPos++;
        }
        return 1;
      }
    } else {
      return 1;
    }
  } else {
    if (fuPos == myPos) {
      myPos = nwPos;
      return 1;
    } else {
      myPos = nwPos;
      return 1;
    }
  }
}
inline int check1() {
  int x = 0;
  for (int i = 0; i < (int)(timeLine).length(); ++i) {
    int nwPos = C;
    int fuPos = givePos(C);
    int d = decision(nwPos, fuPos, S, timeLine[i]);
    C = fuPos;
    if (d == -1) return i + 1;
  }
  return -1;
}
inline void proc() {
  int d = check1();
  if (d == -1) {
    cout << "Stowaway\n";
  } else {
    cout << "Controller " << d << "\n";
  }
}
int main() {
  read();
  proc();
  return 0;
}
