#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, K;
  while (cin >> N >> M >> K) {
    string to, dirStr;
    cin >> to >> dirStr;
    int dir = dirStr == "head" ? 0 : 1;
    string state;
    cin >> state;
    int res = -1;
    for (int i = 0; i < (int)(state.size()); i++) {
      if (state[i] == '0') {
        if (dir == 0) {
          M = max(1, M - 1);
          K = max(1, K - 1);
        } else {
          M = min(N, M + 1);
          K = min(N, K + 1);
        }
        if (M == K) {
          res = i + 1;
          break;
        }
        if (K == 1 || K == N) dir = 1 - dir;
      } else {
        if (dir == 0) {
          K = max(1, K - 1);
        } else {
          K = min(N, K + 1);
        }
        if (K == 1 || K == N) dir = 1 - dir;
        if (dir == 0) {
          if (K == N)
            M = 1;
          else
            M = N;
        } else {
          if (K == 1)
            M = N;
          else
            M = 1;
        }
      }
    }
    if (res == -1)
      cout << "Stowaway" << endl;
    else
      cout << "Controller " << res << endl;
  }
  return 0;
}
