#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, s, c, cd;
  cin >> n >> s >> c;
  scanf("\n");
  string dir;
  getline(cin, dir);
  if (dir == "to head")
    cd = -1;
  else
    cd = 1;
  string state;
  cin >> state;
  int sz = state.size();
  int cwin = -1;
  for (int i = 0; cwin == -1 && i < sz; i++) {
    if (c == 1)
      cd = 1;
    else if (c == n)
      cd = -1;
    if (state[i] == '1') {
      c = c + cd;
      if (cd == -1) {
        if (c != n)
          s = n;
        else
          s = 1;
      } else {
        if (c != 0)
          s = 1;
        else
          s = n;
      }
    } else {
      if ((c + cd == n && s == n) || (c + cd == 1 && s == 1))
        cwin = i + 1;
      else if (s + cd <= n && s + cd >= 1)
        s = s + cd;
      c = c + cd;
    }
  }
  if (cwin != -1)
    cout << "Controller " << cwin;
  else
    cout << "Stowaway";
  return 0;
}
