#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int N = 55;
int n, a, b, d;
int ok;
void go_b() {
  if (d == 1) {
    b++;
    if (b > n) {
      b = n - 1;
      d = 0;
    }
  } else {
    b--;
    if (b < 1) {
      b = 2;
      d = 1;
    }
  }
  if (a == b) ok = 1;
}
void go_a() {
  if (d == 1 && a < b || d == 0 && a < b) {
    a--;
    if (a < 1) a = 1;
  } else {
    a++;
    if (a > n) a = n;
  }
}
int main() {
  int i, j, k, t, nc = 0;
  while (cin >> n) {
    cin >> a >> b;
    string str1, str2;
    cin >> str1 >> str2;
    cin >> str1;
    if (str2 == "tail")
      d = 1;
    else
      d = 0;
    ok = 0;
    for (i = 0; i < str1.size(); i++) {
      if (str1[i] == '0') {
        go_a();
        go_b();
      } else {
        a = -1;
        go_b();
        if (d == 1)
          a = 1;
        else
          a = n;
      }
      if (ok) {
        ok = i + 1;
        break;
      }
    }
    if (ok)
      cout << "Controller " << ok << endl;
    else
      cout << "Stowaway" << endl;
  }
  return 0;
}
