#include <bits/stdc++.h>
using namespace std;
const long long N = 1e9;
const long long NN = 1e18;
const int32_t M = 1e9 + 7;
const int32_t MM = 998244353;
template <typename T, typename T1>
T maxn(T &a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T minn(T &a, T1 b) {
  if (b < a) a = b;
  return a;
}
void solve() {
  long long int n, k, m;
  cin >> n >> k >> m;
  m--;
  k--;
  string to, dir;
  cin >> to >> dir;
  long long int chng = 0;
  if (dir == "head")
    chng = -1;
  else
    chng = 1;
  string second;
  cin >> second;
  for (long long int(i) = 0; (i) < ((long long int)second.size()); (i)++) {
    if (second[i] == '0') {
      if (m + chng >= n || m + chng < 0) chng *= -1;
      m += chng;
      if (m == k) {
        if (k + chng < n && k + chng >= 0) k += chng;
      }
      if (m == k) {
        cout << "Controller ";
        cout << i + 1;
        return;
      }
    } else {
      if (i == (long long int)second.size() - 1) {
        cout << "Stowaway";
        return;
      }
      if (m + chng >= n || m + chng < 0) chng *= -1;
      if (chng > 0) {
        k = 0;
      } else {
        k = n - 1;
      }
      m += chng;
    }
  }
  cout << "Stowaway";
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int testcase = 1;
  while (testcase--) solve();
  return 0;
}
