#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, s1, s2;
  cin >> n >> s1 >> s2;
  string t1, t2;
  cin >> t1 >> t2;
  string move;
  cin >> move;
  bool to_left = (t2 == "head") ? true : false;
  for (int i = 0; i < move.size(); i++) {
    if (move[i] == '1' && i == (int)move.size() - 1) {
      cout << "Stowaway" << endl;
      return 0;
    }
    if (move[i] == '1') {
      if (to_left) {
        s2--;
        if (s2 == 1) to_left = false;
      } else {
        s2++;
        if (s2 == n) to_left = true;
      }
      if (to_left) {
        if (s2 != n)
          s1 = n;
        else
          s1 = 1;
      } else {
        if (s2 != 1)
          s1 = 1;
        else
          s1 = n;
      }
    } else {
      if (to_left) {
        if (s1 > s2) {
          if (s1 != n) s1++;
        } else {
          if (s1 != 1) s1--;
        }
        s2--;
        if (s1 == s2) {
          cout << "Controller" << ' ' << i + 1 << endl;
          return 0;
        }
        if (s2 == 1) to_left = false;
      } else {
        if (s1 > s2) {
          if (s1 != n) s1++;
        } else {
          if (s1 != 1) s1--;
        }
        s2++;
        if (s1 == s2) {
          cout << "Controller" << ' ' << i + 1 << endl;
          return 0;
        }
        if (s2 == n) to_left = true;
      }
    }
  }
  cout << "Stowaway" << endl;
  return 0;
}
