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