#include <bits/stdc++.h>
using namespace std;
int n, m, k;
char fa[300], l;
int main() {
  scanf("%d%d%d", &n, &k, &m);
  scanf("%cto %s", &l, fa);
  int fk;
  if (fa[0] == 'h')
    fk = 1;
  else
    fk = 0;
  scanf("%s", fa);
  int len = strlen(fa);
  if (k > m)
    k = n;
  else
    k = 1;
  for (int i = 0; i < len; i++) {
    if (fa[i] == '1') {
      if (fk)
        k = n;
      else
        k = 1;
    }
    if (fk)
      m--;
    else
      m++;
    if (m == k) {
      printf("Controller %d\n", i + 1);
      return 0;
    }
    if (m == 1)
      fk = 0;
    else if (m == n)
      fk = 1;
  }
  printf("Stowaway\n");
}
