#include <bits/stdc++.h>
using namespace std;
bool debug = true;
template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2> ptt) {
  os << ptt.first << "," << ptt.second;
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vt) {
  os << "{";
  for (int i = 0; i < vt.size(); i++) {
    os << vt[i] << " ";
  }
  os << "}";
  return os;
}
int n, posS, posC;
int dir;
string s;
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(0);
  cin >> n >> posS >> posC;
  string a, b;
  cin >> a >> b;
  if (b == "head") {
    dir = -1;
  } else {
    dir = 1;
  }
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') {
      if (posS != 1 && posS != n) {
        posS += dir;
      }
      posC += dir;
      if (posS == posC) {
        cout << "Controller"
             << " " << i + 1;
        return 0;
      }
      if (posC == 1 || posC == n) {
        dir = 0 - dir;
      }
    } else {
      posC += dir;
      if (dir == -1) {
        posS = n;
      } else {
        posS = 1;
      }
      if (posC == 1 || posC == n) {
        dir = 0 - dir;
      }
    }
  }
  cout << "Stowaway";
  return 0;
}
