#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, i, j;
  string t, direction, seq;
  cin >> n >> m >> k >> t >> direction >> seq;
  int step = 1;
  if (direction == "head") step = -1;
  for (i = 0; i < seq.length(); ++i) {
    if (seq[i] == '1') {
      if (step > 0)
        m = 1;
      else
        m = n;
    } else {
      m += step;
      if (m < 1) m = 1;
      if (m > n) m = n;
    }
    k += step;
    if (k == n || k == 1) step *= -1;
    if (k == m) {
      cout << "Controller " << i + 1;
      return 0;
    }
  }
  cout << "Stowaway";
  return 0;
}
