#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int n, stow, contr, waittime = 0, delta;
string dir, st;
vector<int> ost;
int main() {
  cin >> n >> stow >> contr;
  string tmp;
  cin >> tmp >> dir >> st;
  if (stow > contr)
    stow = n;
  else if (stow < contr)
    stow = 1;
  for (int i = 0; i < st.length(); ++i) {
    if (st[i] == '0') {
      if (dir == "head" && contr != 2)
        contr--;
      else if (dir == "head" && contr == 2) {
        contr--;
        dir = "tail";
      } else if (dir == "tail" && contr != n - 1)
        contr++;
      else if (dir == "tail" && contr == n - 1) {
        contr++;
        dir = "head";
      }
      if (contr == stow) {
        cout << "Controller " << i + 1;
        exit(0);
      }
    }
    if (st[i] == '1') {
      if (dir == "head" && contr != 2)
        contr--;
      else if (dir == "head" && contr == 2) {
        contr--;
        dir = "tail";
      } else if (dir == "tail" && contr != n - 1)
        contr++;
      else if (dir == "tail" && contr == n - 1) {
        contr++;
        dir = "head";
      }
      if (dir == "head" && contr != n)
        stow = n;
      else if (dir == "head" && contr == n)
        stow = 1;
      else if (dir == "tail" && contr != 1)
        stow = 1;
      else if (dir == "tail" && contr == 1)
        stow = n;
      if (contr == stow) {
        cout << "Controller " << i + 1;
        exit(0);
      }
    }
  }
  cout << "Stowaway";
  return 0;
}
