#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
int main() {
  int n, m, k;
  while (cin >> n >> m >> k) {
    m--;
    k--;
    string s;
    cin >> s;
    cin >> s;
    string a;
    cin >> a;
    int stowa, cont;
    if (s == "head")
      cont = -1;
    else
      cont = 1;
    if (m < k)
      stowa = -1;
    else
      stowa = 1;
    bool f = 1;
    for (int i = 0; i < (int)a.size(); ++i) {
      if (a[i] == '0') {
        if (0 <= m + stowa && m + stowa < n) m += stowa;
      } else {
        m = -1;
      }
      k += cont;
      if (k == 0)
        cont = 1;
      else if (k == n - 1)
        cont = -1;
      if (k == m) {
        cout << "Controller " << i + 1 << endl;
        f = 0;
        break;
      }
      if (a[i] == '1') {
        stowa = 0;
        if (cont == -1) {
          if (k == n - 1)
            m = 0;
          else
            m = n - 1;
        } else {
          if (k == 0)
            m = n - 1;
          else
            m = 0;
        }
      }
    }
    if (f) {
      cout << "Stowaway" << endl;
    }
  }
}
