#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int p;
string f;
void emulCont() {
  k = k + p;
  if (k == 0 || k == n - 1) {
    p = -p;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  string tmp;
  cin >> tmp >> tmp;
  if (tmp == "head")
    p = -1;
  else
    p = 1;
  m--;
  k--;
  cin >> f;
  bool ost = 0;
  for (int i = 0; i < f.length(); i++) {
    if (ost && f[i] == '1') {
      emulCont();
    } else if (ost) {
      ost = 0;
      m = k - p;
      if (m < 0) m = n - 1;
      if (m >= n) m = 0;
      emulCont();
      if (k == m) {
        cout << "Controller " << (i + 1);
        return 0;
      }
    } else if (f[i] == '1') {
      ost = 1;
      emulCont();
    } else {
      if (k + p == m) {
        m = m + p;
        if (m < 0 || m >= n) {
          cout << "Controller " << (i + 1);
          return 0;
        }
      }
      emulCont();
    }
  }
  cout << "Stowaway";
  return 0;
}
