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