#include <bits/stdc++.h>
using namespace std;
int v[201];
int n, c, p, dir;
void moveC() {
  if (dir == -1) {
    if (c > 1)
      c--;
    else
      dir = 1, c++;
  } else {
    if (c < n)
      c++;
    else
      dir = -1, c--;
  }
}
int main() {
  string a;
  cin >> n >> p >> c >> a >> a;
  dir = a == "head" ? -1 : 1;
  cin >> a;
  for (int i = 0, lg = a.size(); i < lg; i++) {
    if (a[i] == '0') {
      p = (p < c) ? (p > 1 ? p - 1 : 1) : (p < n ? p + 1 : n);
      moveC();
    } else {
      moveC();
      p = dir == -1 ? (c == n ? 1 : n) : (c == 1 ? n : 1);
    }
    if (p == c) {
      cout << "Controller " << i + 1;
      return 0;
    }
  }
  cout << "Stowaway";
  return 0;
}
