#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, k, d;
  string s, to, dir;
  cin >> n >> m >> k >> to >> dir >> s;
  if (dir == "head")
    d = -1;
  else
    d = 1;
  if (k == 1 && d == -1) {
    d = 1;
  } else if (k == n && d == 1) {
    d = -1;
  }
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') {
      if (m < k && m > 1) {
        m--;
      } else if (m > k && m < n) {
        m++;
      }
    } else {
      if (d == -1) {
        m = n;
      } else {
        m = 1;
      }
    }
    k += d;
    if (m == k) {
      cout << "Controller " << i + 1 << '\n';
      return 0;
    }
    if (k == 1 && d == -1) {
      d = 1;
    } else if (k == n && d == 1) {
      d = -1;
    }
  }
  cout << "Stowaway\n";
  return 0;
}
