#include <bits/stdc++.h>
using namespace std;
string s1, s2, s;
long n, m, k, z, contr, way, now;
void imitate() {
  if (contr + way > n) {
    contr--;
    way = -1;
  } else if (contr + way < 1) {
    contr++;
    way = 1;
  } else
    contr += way;
}
long get_dist(long p) {
  long was1 = contr;
  long was2 = way;
  long time;
  for (time = 0; time <= n; time++) {
    if (p == contr) break;
    imitate();
  }
  contr = was1;
  way = was2;
  return (time);
}
void move_1() {
  long best = -1;
  long res;
  for (long choice = 1; choice <= n; choice++) {
    long nnew = get_dist(choice);
    if (nnew > best) {
      best = nnew;
      res = choice;
    }
  }
  now = res;
}
void move_2() {
  long best = -1;
  long res;
  for (long choice = max(z, now - 1); choice <= min(now + 1, n); choice++) {
    long nnew = get_dist(choice);
    if (nnew > best) {
      best = nnew;
      res = choice;
    }
  }
  now = res;
}
void solve() {
  contr = k;
  if (s2 == "tail")
    way = 1;
  else
    way = -1;
  now = m;
  long i;
  bool fail = false;
  for (i = 0; i <= s.length() - 1; i++) {
    if (now == contr) {
      fail = true;
      break;
    }
    if (i == s.length() - 1) break;
    if (s[i] == '1') {
      imitate();
      move_1();
    } else {
      move_2();
      imitate();
    }
  }
  if (fail == true)
    printf("Controller %ld", i);
  else
    printf("Stowaway");
}
int main() {
  scanf("%ld%ld%ld\n", &n, &m, &k);
  cin >> s1 >> s2;
  scanf("\n");
  cin >> s;
  z = 1;
  solve();
}
