#include <bits/stdc++.h>
using namespace std;
int n, m, k, t;
string s1, s2, second;
int main() {
  cin >> n >> m >> k;
  cin >> s1 >> s2 >> second;
  if (s2 == "head")
    t = 0;
  else
    t = 1;
  for (int i = 0; i < second.length(); i++)
    if (second[i] == '0') {
      if (m < k && m > 1) m--;
      if (m > k && m < n) m++;
      if (t) {
        if (k == n)
          k--, t = 0;
        else
          k++;
      } else {
        if (k == 1)
          k++, t = 1;
        else
          k--;
      }
      if (m == k) {
        cout << "Controller " << i + 1 << endl;
        return 0;
      }
    } else {
      if (t) {
        if (k == n)
          k--, t = 0;
        else
          k++;
      } else {
        if (k == 1)
          k++, t = 1;
        else
          k--;
      }
      if (t) {
        if (k == 1)
          m = n;
        else
          m = 1;
      } else {
        if (k == n)
          m = 1;
        else
          m = n;
      }
      if (m == k) {
        cout << "Controller " << i + 1 << endl;
        return 0;
      }
    }
  cout << "Stowaway" << endl;
  return 0;
}
