#include <bits/stdc++.h>
using namespace std;
int n, z, k, q = 1;
bool ins(int x) { return x > 0 && x <= n; }
int main() {
  cin >> n >> z >> k;
  string x;
  cin >> x;
  cin >> x;
  if (x == "head") q = -1;
  char c;
  int turn = 0;
  while (scanf(" %c", &c) == 1) {
    turn++;
    if (c == '0') {
      if (z + q == k || z + 2 * q == k) {
        if (ins(z - q)) z -= q;
      } else {
        if (ins(z + q)) z += q;
      }
      if (ins(k + q))
        k += q;
      else
        k += (q = -q);
    } else {
      if (ins(k + q))
        k += q;
      else
        k += (q = -q);
      if (ins(k - q))
        z = k - q;
      else
        z = k + q;
    }
    if (z == k) {
      printf("Controller %d\n", turn);
      return 0;
    }
  }
  puts("Stowaway");
  return 0;
}
