#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  string s, T;
  cin >> s >> s >> T;
  bool x = false;
  if (s == "head") x = true;
  int X = T.size();
  for (int i = 0; i < X; i++) {
    if (T[i] == '1')
      m = 0;
    else {
      if (i != 0 && T[i - 1] == '1') {
        if (x)
          m = n;
        else
          m = 1;
      }
      if (k < m) {
        if (m < n) m++;
      } else if (m > 1)
        m--;
    }
    if (k == n) x = true;
    if (k == 1) x = false;
    if (x)
      k--;
    else
      k++;
    if (k == m) {
      cout << "Controller " << i + 1;
      return 0;
    }
  }
  cout << "Stowaway";
  return 0;
}
