#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:10000000")
using namespace std;
template <typename T>
inline T abs(T a) {
  return ((a < 0) ? -a : a);
}
template <typename T>
inline T sqr(T a) {
  return a * a;
}
const int INF = (int)1E9 + 7;
const long double EPS = 1E-9;
const long double PI = 3.1415926535897932384626433832795;
int Cpos[300], n, z, c;
string s, dir;
const int dx[2] = {1, -1};
const string dn[2] = {"to tail", "to head"};
int sign(int x) {
  if (x == 0) return 0;
  return x < 0 ? -1 : 1;
}
int main() {
  cin >> n >> z >> c;
  z--, c--;
  getline(cin, dir);
  getline(cin, dir);
  getline(cin, s);
  int now = find(dn, dn + 2, dir) - dn;
  int curPos = c;
  for (int i = 0; i < int(int((s).size())); ++i) {
    curPos += dx[now];
    if (curPos < 0) {
      curPos = 1;
      now = 1 - now;
    }
    if (curPos >= n) {
      curPos = n - 2;
      now = 1 - now;
    }
    Cpos[i] = curPos;
  }
  for (int i = 0; i < int(int((s).size())); ++i) {
    if (s[i] == '0') {
      z = z + -sign(c - z);
      z = min(max(z, 0), n - 1);
      c = Cpos[i];
    } else {
      z = INF;
      c = Cpos[i];
      if (i == int((s).size()) - 1) {
        break;
      }
      int t1 = INF, t2 = INF;
      for (int j = int(i); j < int(int((s).size())); ++j) {
        if (Cpos[j] == 0 && t1 == INF) {
          t1 = j - i;
        }
        if (Cpos[j] == n - 1 && t2 == INF) {
          t2 = j - i;
        }
      }
      if (t1 > t2)
        z = 0;
      else
        z = n - 1;
    }
    if (c == z) {
      printf("Controller %d\n", i + 1);
      exit(0);
    }
  }
  puts("Stowaway");
  return 0;
}
