#include <bits/stdc++.h>
int n, m, k;
FILE* f1 = stdin;
int main() {
  fscanf(f1, "%d%d%d", &n, &m, &k);
  int i = 0;
  char ar[6];
  char is[205];
  fscanf(f1, "%s", ar);
  fscanf(f1, "%s", ar);
  fscanf(f1, "%s", is);
  int d = 0;
  if (strcmp(ar, "tail") == 0)
    d = 1;
  else
    d = -1;
  i = 0;
  while (k != m && i != strlen(is)) {
    if (is[i] == '1') {
      m = 0;
      k += d;
      if (k == 0) {
        k = 2;
        d = 1;
      }
      if (k == n + 1) {
        k = n - 1;
        d = -1;
      }
    }
    if (i != 0)
      if (is[i - 1] == '1') {
        if (d == 1)
          m = 1;
        else
          m = n;
      }
    if (is[i] == '0') {
      if (m - 1 != 0 && m + 1 != n + 1) {
        if (m - 1 > k - 1)
          m++;
        else
          m--;
      }
      k += d;
      if (k == 0) {
        k = 2;
        d = 1;
      }
      if (k == n + 1) {
        k = n - 1;
        d = -1;
      }
    }
    i++;
  }
  if (k == m)
    printf("Controller %d\n", i);
  else
    printf("Stowaway\n");
  scanf("%*d");
}
