#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int n;
int m, l, r, k;
string s, a, b;
int was[51][51][201];
int qi[51 * 51 * 201];
int qj[51 * 51 * 201];
int qt[51 * 51 * 201];
int qd[51 * 51 * 201];
int upd(int i, int j, int t, int d) {
  if (!was[i][j][t]) {
    was[i][j][t] = 1;
    qi[r] = i;
    qj[r] = j;
    qt[r] = t;
    qd[r] = d;
    r++;
  }
  return 0;
}
int main() {
  cin >> n >> m >> k;
  m--;
  k--;
  cin >> a >> b;
  cin >> s;
  int len = ((int)(s).size());
  int d;
  if (b == "head")
    d = -1;
  else
    d = 1;
  l = 0;
  r = 1;
  qi[0] = m;
  qj[0] = k;
  qt[0] = 0;
  qd[0] = d;
  was[m][k][0] = 1;
  while (l < r) {
    int i = qi[l];
    int j = qj[l];
    int t = qt[l];
    int d = qd[l];
    if (t + 1 == len) {
      printf("Stowaway\n");
      return 0;
    }
    l++;
    if (j + d < 0 || j + d >= n) d = -d;
    if (s[t] == '0') {
      if (i + 1 < n && i + 1 != j && i + 1 != j + d)
        upd(i + 1, j + d, t + 1, d);
      if (i != j + d) upd(i, j + d, t + 1, d);
      if (i - 1 >= 0 && i - 1 != j && i - 1 != j + d)
        upd(i - 1, j + d, t + 1, d);
    } else {
      for (int k = 0; k < n; k++)
        if (k != j + d) upd(k, j + d, t + 1, d);
    }
  }
  printf("Controller %d\n", qt[r - 1] + 1);
  return 0;
}
