#include <bits/stdc++.h>
using namespace std;
int N, M, K, f, L, Ans;
char Str[100], T[1000];
int main() {
  scanf("%d%d%d\n", &N, &M, &K);
  gets(Str);
  if (Str[3] == 'h')
    f = -1;
  else
    f = 1;
  scanf("%s", T);
  L = strlen(T);
  for (int i = 0; i < L; ++i) {
    if ((K == 1 && f == -1) || (K == N && f == 1)) f = -f;
    K += f;
    if (M + f <= N && M + f >= 1) M += f;
    if (T[i] == '1') {
      if (K == N || K == 1)
        M = N + 1 - K;
      else
        M = (f == 1) ? 1 : N;
    }
    if (K == M) {
      Ans = i + 1;
      break;
    }
  }
  if (Ans)
    printf("Controller %d\n", Ans);
  else
    printf("Stowaway\n");
  return 0;
}
