#include <bits/stdc++.h>
using namespace std;
void adjust(int &k, int n) {
  if (k < 1) k = 1;
  if (k > n) k = n;
}
void solve() {
  int n, S, C;
  cin >> n >> S >> C;
  string sdir;
  cin >> sdir;
  cin >> sdir;
  int dir = (sdir == "head") ? -1 : 1;
  string train;
  cin >> train;
  int min = 0;
  for (int i = 0; i < int(train.size()) - 1; ++i) {
    assert(C != S);
    if (train[i] == '0') {
      if (dir * (S - C) > 0) {
        S += dir;
        adjust(S, n);
      } else {
        S -= dir;
        adjust(S, n);
      }
      C += dir;
    } else {
      C += dir;
      if (C == 1)
        S = n;
      else if (C == n)
        S = 1;
      else if (dir > 0)
        S = 1;
      else
        S = n;
    }
    if (C == 1 || C == n) dir = -dir;
    if (S == C) {
      min = i + 1;
      break;
    }
  }
  if (S == C)
    cout << "Controller " << min << endl;
  else
    cout << "Stowaway\n";
}
int main() { solve(); }
