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