#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
using vc = vector<T>;
ll n, m, k, d;
char s[210];
int main() {
  scanf("%lld %lld %lld", &n, &m, &k);
  scanf("%s %s", s, s);
  d = strcmp(s, "head") == 0 ? -1 : 1;
  scanf("%s", s);
  for (ll i = 0, len = strlen(s); i < len; i++) {
    if (k == n && d == 1) d = -1;
    if (k == 1 && d == -1) d = 1;
    m = (s[i] == '0' ? (m != 1 && m != n ? m + d : m) : (d == 1 ? 1 : n));
    k += d;
    if (k == m) {
      printf("Controller %lld\n", i + 1);
      return 0;
    }
  }
  printf("Stowaway\n");
  return 0;
}
