#include <bits/stdc++.h>
using namespace std;
int dir;
int n, m, k;
int go(int pos) {
  if (pos == 1) {
    dir = 1;
    return pos + 1;
  }
  if (pos == n) {
    dir = 0;
    return pos - 1;
  }
  if (dir) return pos + 1;
  return pos - 1;
}
int main() {
  cin >> n >> m >> k;
  string napr, isstop;
  cin >> napr >> napr;
  cin >> isstop;
  if (napr == "head")
    dir = 0;
  else
    dir = 1;
  for (int i = 0; i < isstop.size(); i++) {
    if (isstop[i] == '1') {
      k = go(k);
      if (dir == 0) {
        if (k == n)
          m = 1;
        else
          m = n;
      } else {
        if (k == 1)
          m = n;
        else
          m = 1;
      }
    } else {
      if (dir == 0) {
        if (m < k) {
          m--;
          m = max(1, m);
        } else {
          m++;
          m = min(m, n);
        }
      } else {
        if (m > k) {
          m++;
          m = min(m, n);
        } else {
          m--;
          m = max(1, m);
        }
      }
      k = go(k);
    }
    if (m == k) {
      cout << "Controller " << i + 1;
      return 0;
    }
  }
  cout << "Stowaway";
  return 0;
}
