#include <bits/stdc++.h>
int kx[8] = {+2, +2, -2, -2, +1, +1, -1, -1};
int ky[8] = {+1, -1, +1, -1, +2, -2, +2, -2};
int d9x[9] = {+1, +1, +1, +0, +0, +0, -1, -1, -1};
int d9y[9] = {+1, +0, -1, +1, +0, -1, +1, +0, -1};
int dx4[4] = {+0, +0, +1, -1};
int dy4[4] = {+1, -1, +0, +0};
long long int gcd(unsigned long long int a, unsigned long long int b) {
  return (a == 0) ? b : gcd(b % a, a);
}
long long int lcm(unsigned long long int a, unsigned long long int b) {
  return a * (b / gcd(a, b));
}
const long long INF = 1e18;
const long long ALPH_SIZE = 256;
using namespace std;
inline void modulo(long long int& x) {
  if (x >= 1000000007) {
    x %= 1000000007;
  }
  return;
}
int n, m, k, l;
bool to_head;
bool path[201];
int conpos[201];
void fill_conpos() {
  int pos = k;
  int t = 0;
  while (t <= l) {
    if (pos == n - 1) {
      to_head = true;
    } else if (pos == 0) {
      to_head = false;
    }
    conpos[t] = pos;
    ++t;
    if (to_head) {
      --pos;
    } else {
      ++pos;
    }
  }
  return;
}
long long int dp[51 + 1][201];
long long int best[201];
int main() {
  cin >> n >> m >> k;
  --m;
  --k;
  string tmp;
  cin >> tmp >> tmp;
  to_head = (tmp == "head");
  cin >> tmp;
  l = tmp.size();
  for (int i = 0; i < l; ++i) {
    path[i] = (tmp[i] == '1');
  }
  fill_conpos();
  for (int t = l - 1; ~t; --t) {
    for (int p = 0; p < n; ++p) {
      if (conpos[t] == p) {
        dp[p][t] = t;
        best[t] = max(best[t], dp[p][t]);
        continue;
      }
      if (t == l - 1) {
        dp[p][t] = INF;
        best[t] = max(best[t], dp[p][t]);
        continue;
      }
      if (path[t]) {
        dp[p][t] = best[t + 1];
      } else {
        long long int a;
        if (p > 0) {
          if (conpos[t] == p - 1) {
            a = t;
          } else {
            a = dp[p - 1][t + 1];
          }
        } else {
          a = 0;
        }
        long long int b;
        if (p < n - 1) {
          if (conpos[t] == p + 1) {
            b = t;
          } else {
            b = dp[p + 1][t + 1];
          }
        } else {
          b = 0;
        }
        long long int c;
        c = dp[p][t + 1];
        dp[p][t] = max(a, max(b, c));
      }
      best[t] = max(best[t], dp[p][t]);
    }
  }
  if (dp[m][0] == INF) {
    cout << "Stowaway\n";
  } else {
    cout << "Controller " << dp[m][0] << endl;
  }
}
