#include <bits/stdc++.h>
using namespace std;
char cmd[100], rundown[500];
int n, m, k, d, t, ds;
void init() {
  scanf("%d%d%d", &n, &m, &k);
  scanf("%s", cmd);
  scanf("%s", cmd);
  scanf("%s", rundown);
  t = strlen(rundown);
  if (cmd[0] == 'h')
    d = -1;
  else
    d = 1;
}
int solve() {
  for (int i = 0; i < t; i++) {
    if (k == 1 && d == -1 || k == n && d == 1) d *= -1;
    if (rundown[i] == '0') {
      if (d == -1) {
        if (m >= 1 && m <= k)
          ds = -1;
        else
          ds = 1;
      } else {
        if (m >= k && m <= n)
          ds = 1;
        else
          ds = -1;
      }
      if (m + ds >= 1 && m + ds <= n && m + ds != k) m += ds;
      k += d;
      if (k == m) return i + 1;
    } else {
      m = -1;
      k += d;
      if (k == 1 && d == -1 || k == n && d == 1) d *= -1;
      if (k == 1)
        m = n;
      else if (k == n)
        m = 1;
      else if (d == 1)
        m = 1;
      else
        m = n;
    }
  }
  return -1;
}
int main() {
  init();
  int ret = solve();
  if (ret == -1)
    puts("Stowaway");
  else
    printf("Controller %d\n", ret);
  return 0;
}
