#include <bits/stdc++.h>
using namespace std;
int d, n, s, c;
string t1, inp1;
int main(void) {
  cin >> n >> s >> c;
  getline(cin, t1);
  getline(cin, t1);
  cin >> inp1;
  d = (t1 == "to head") ? -1 : 1;
  for (int i = 0; i < inp1.size(); i++) {
    if (inp1[i] == '0') {
      if (s > c && s < n) s++;
      if (s < c && s > 1) s--;
      if (c + d < 1 || c + d > n) d *= -1;
      c += d;
      if (c == s) {
        cout << "Controller " << i + 1 << endl;
        return 0;
      }
    } else {
      if (c + d < 1 || c + d > n) d *= -1;
      c += d;
      s = d == 1 ? 1 : n;
    }
  }
  cout << "Stowaway" << endl;
  return 0;
}
