#include <bits/stdc++.h>
using namespace std;
const int N = 501;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, x, y, dir;
  cin >> n >> x >> y;
  string s, t;
  cin >> t >> s;
  if (s == "head")
    dir = -1;
  else
    dir = 1;
  s.clear();
  cin >> s;
  for (int i = 0; i < s.length(); ++i) {
    if (y + dir < 1 || y + dir > n) {
      dir = (dir == 1) ? -1 : 1;
    }
    if (s[i] == '0') {
      if (y > x) {
        if (x > 1) --x;
      } else {
        if (x < n) ++x;
      }
    } else {
      if (dir == 1)
        x = 1;
      else
        x = n;
    }
    y += dir;
    if (x == y) return cout << "Controller " << i + 1, 0;
  }
  cout << "Stowaway";
}
