#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  if (m > k)
    m = n;
  else
    m = 1;
  int napr = 1;
  string s, z("0");
  cin >> s >> s;
  if (s != "tail") napr -= 2;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    k += napr;
    if (s[i] == z[0]) {
      if (k == m) {
        cout << "Controller " << i + 1 << endl;
        return 0;
      }
    } else {
      if (napr == 1)
        m = 1;
      else
        m = n;
    }
    if (k == 1 || k == n) napr *= -1;
  }
  cout << "Stowaway" << endl;
  return 0;
}
