#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, z, k;
  cin >> n >> z >> k;
  z--;
  k--;
  bool toHead;
  string tmp;
  cin >> tmp;
  cin >> tmp;
  toHead = tmp == "head";
  string t;
  cin >> t;
  for (int i = 0; i < t.length(); ++i) {
    if (t[i] == '0') {
      if (k > z && z > 0)
        z--;
      else if (k < z && z < n - 1)
        z++;
    } else {
      if (toHead)
        z = n - 1;
      else
        z = 0;
    }
    if (toHead) {
      if (k > 0) k--;
      if (k == 0) toHead = false;
    } else {
      if (k < n - 1) k++;
      if (k == n - 1) toHead = true;
    }
    if (k == z) {
      cout << "Controller " << i + 1 << endl;
      return 0;
    }
  }
  cout << "Stowaway" << endl;
  return 0;
}
