#include <bits/stdc++.h>
using namespace std;
const int SIZ = 100000;
const int INF = (1 << 29);
const double EPS = 1e-11;
const double PI = acos(-1.0);
int MAX(int a, int b) { return a > b ? a : b; }
int MIN(int a, int b) { return a < b ? a : b; }
int GCD(int a, int b) {
  while (b) {
    b ^= a ^= b ^= a %= b;
  }
  return a;
}
int N, ln;
char A[SIZ];
int f(int s, int c, int d, int t) {
  if (t == ln) return INF;
  if (s == c) return t;
  if (c == N - 1 && d == 1) d = -1;
  if (c == 0 && d == -1) d = 1;
  int r1, r2, r3, r4;
  if (A[t] == '1') {
    if (d == -1)
      r1 = f(N - 1, c + d, d, t + 1);
    else
      r1 = f(0, c + d, d, t + 1);
  } else {
    if (s + d == N || s + d == -1) {
      r1 = f(s, c + d, d, t + 1);
    } else {
      if (s + d == c)
        r1 = f(s, c + d, d, t + 1);
      else
        r1 = f(s + d, c + d, d, t + 1);
    }
  }
  return r1;
}
int main() {
  int st, cn, res, d;
  char B[SIZ];
  scanf("%d %d %d", &N, &st, &cn);
  st--, cn--;
  getchar();
  gets(B);
  gets(A);
  ln = strlen(A);
  if (!strcmp(B, "to head"))
    d = -1;
  else
    d = 1;
  res = f(st, cn, d, 0);
  if (res == INF)
    printf("Stowaway\n");
  else
    printf("Controller %d\n", res);
  return 0;
}
