#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VL = vector<LL>;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
void dout() { cerr << endl; }
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
  cerr << H << ' ';
  dout(T...);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, z, k;
  cin >> n >> z >> k;
  z--;
  k--;
  string dir;
  cin >> dir;
  cin >> dir;
  bool right = false;
  if (dir == "tail") right = true;
  string s;
  cin >> s;
  for (int i = (0); i < ((int)s.size()); ++i) {
    if (s[i] == '1') {
      if (right) {
        z = 0;
        k++;
      } else {
        z = n - 1;
        k--;
      }
    } else {
      if (right) {
        if (z > k && z < n - 1) z++;
        k++;
      } else {
        if (z < k && z > 0) z--;
        k--;
      }
      if (k == z) {
        cout << "Controller ";
        cout << i + 1 << "\n";
        return 0;
      }
    }
    if (k == n - 1) right = false;
    if (k == 0) right = true;
  }
  cout << "Stowaway";
  return 0;
}
