#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> k >> m;
  string a, b;
  cin >> a >> b;
  m--;
  k--;
  string s;
  cin >> s;
  int g = 0;
  if (b == "head") {
    g = 1;
  }
  int l = s.length();
  int r;
  for (int i = 0; i < l; i++) {
    r = m;
    if (g == 0) {
      if (m + 1 < n) {
        m = m + 1;
      } else {
        m = m - 1;
        g = 1;
      }
    } else if (g == 1) {
      if (m - 1 < 0) {
        m = m + 1;
        g = 0;
      } else {
        m = m - 1;
      }
    }
    if (s[i] == '0') {
      if (abs(r - k) > abs(m - k)) {
        if (g == 1) {
          k = max(0, k - 1);
        }
        if (g == 0) {
          k = min(n - 1, k + 1);
        }
      }
    }
    if (s[i] == '1') {
      if (g == 0) {
        k = 0;
      } else
        k = n - 1;
    }
    if (k == m) {
      cout << "Controller"
           << " " << i + 1 << "\n";
      return 0;
    }
    r = m;
  }
  cout << "Stowaway";
  return 0;
}
