#include <bits/stdc++.h>
using namespace std;
int oo = 1 << 30;
int main() {
  int n, m, k, dir;
  cin >> n >> m >> k;
  string c1, c2;
  cin >> c1 >> c2;
  if (c1 + " " + c2 == "to head")
    dir = -1;
  else
    dir = 1;
  string times;
  cin >> times;
  bool R = true;
  int i;
  for (i = 0; i < times.size() && R; i++) {
    if (times[i] == '0') {
      if (m < k && m - 1 >= 1)
        m--;
      else if (m > k && m + 1 <= n)
        m++;
      if (k + dir < 1 || k + dir > n) dir *= -1;
      k += dir;
    } else {
      if (k + dir < 1 || k + dir > n) dir *= -1;
      k += dir;
      if (dir == -1)
        m = n;
      else
        m = 1;
    }
    if (m == k) R = false;
  }
  if (R)
    cout << "Stowaway" << endl;
  else
    cout << "Controller " << i << endl;
}
