#include <bits/stdc++.h>
using namespace std;
int row[4] = {0, 1, 0, -1}, col[4] = {1, 0, -1, 0};
long long int n, f, k, d, ans, t, T, sum = 0, l, r, m, q, y, b[100001];
string p, s1, s2;
char ch;
double a[100001];
int main() {
  cin >> n >> m >> k;
  cin >> s1 >> s2;
  if (s2 == "head")
    f = 0;
  else
    f = 1;
  cin >> p;
  for (int i = 0; i < p.length(); i++) {
    if (p[i] == '1') {
      if (f)
        m = 1;
      else
        m = n;
    } else {
      if (m < k) {
        if (m > 1) m--;
      }
      if (m > k) {
        if (m < n) m++;
      }
    }
    if (f) {
      k++;
      if (k == n) f = 0;
    } else {
      k--;
      if (k == 1) f = 1;
    }
    if (m == k) {
      cout << "Controller " << (i + 1) << endl;
      return 0;
    }
  }
  cout << "Stowaway" << endl;
  return 0;
}
