#include <bits/stdc++.h>
#pragma comment(linker, "/stack:67108864")
using namespace std;
const long double EPS = 1e-9;
const long double PI = 3.1415926535897932384626433832795;
const long long INF = 1e15;
int main() {
  ifstream ifile("input.txt");
  if (ifile) {
    freopen("input.txt", "rt", stdin);
  }
  int n, m, k;
  while (cin >> n >> m >> k) {
    m--;
    k--;
    string s;
    int np = -1;
    cin >> s;
    cin >> s;
    if (s == "tail") np = 1;
    queue<pair<int, int> > pos;
    pos.push(make_pair(k, m));
    cin >> s;
    for (int i = 0; i < int(s.length()); ++i) {
      int cont = pos.front().first;
      int zaic = pos.front().second;
      pos.pop();
      if (s[i] == '0') {
        if (zaic != 0 && zaic != n - 1) {
          if (zaic > cont)
            zaic++;
          else
            zaic--;
        }
      } else {
        if (np == 1)
          zaic = 0;
        else
          zaic = n - 1;
      }
      cont += np;
      if (cont == n - 1) np = -1;
      if (cont == 0) np = 1;
      if (zaic == cont) {
        cout << "Controller " << i + 1 << endl;
        return 0;
      }
      pos.push(make_pair(cont, zaic));
    }
    cout << "Stowaway" << endl;
  }
  return 0;
}
