#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
bool eq(double a, double b) { return !(fabs(a - b) > 0.000000000001); }
int main() {
  int n, m, k, flag;
  cin >> n >> m >> k;
  string dir, str;
  cin >> dir >> dir;
  cin >> str;
  if (dir == "head")
    flag = 1;
  else
    flag = 0;
  int CURST = m, curc = k, win = 0, res = -1;
  for (int i = 0; i < str.size(); i++) {
    if (curc == CURST) {
      win = 1;
      res = i;
      break;
    }
    if (str[i] == '0') {
      if (!flag) {
        if (CURST == curc + 1) {
          if (CURST < n) CURST++;
        }
      } else if (CURST == curc - 1) {
        if (CURST > 1) CURST--;
      }
      if (flag == 0) {
        if (curc == n - 1) {
          curc = n, flag = 1;
        } else {
          curc = curc + 1;
        }
      } else {
        if (curc == 2) {
          curc = 1, flag = 0;
        } else {
          curc--;
        }
      }
    } else {
      CURST = -1;
      if (i == str.size() - 1) break;
      if (flag == 0) {
        if (curc == n - 1) {
          curc = n, flag = 1;
        } else {
          curc = curc + 1;
        }
      } else {
        if (curc == 2) {
          curc = 1;
          flag = 0;
        } else {
          curc--;
        }
      }
      if (curc == n)
        CURST = n - 1;
      else if (curc == 1)
        CURST = 2;
      else if (flag == 0) {
        CURST = curc - 1;
      } else {
        CURST = curc + 1;
      }
      if (curc == CURST) {
        win = 1;
        res = i;
        break;
      }
    }
  }
  if (res > -1)
    cout << "Controller " << res << endl;
  else
    cout << "Stowaway" << endl;
  return 0;
}
