#include <bits/stdc++.h>
using namespace std;
const int MAXN = 205;
char c[MAXN], str[10];
int n, m, k;
bool sta;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  scanf("\nto %s", str + 1);
  scanf("%s", c + 1);
  int len = strlen(c + 1);
  int dir = (str[1] == 'h') ? 1 : 0;
  m = m < k ? 0 : 1;
  bool flag = 0;
  for (int i = 1; i <= len; ++i) {
    if (c[i] == '1') m = dir;
    if (dir)
      --k;
    else
      ++k;
    if (k == n || k == 1) {
      if ((k == n) == m) {
        flag = 1;
        printf("Controller %d\n", i);
        break;
      }
      dir = 1 - dir;
    }
  }
  if (flag == 0) printf("Stowaway\n");
  return 0;
}
