#include <bits/stdc++.h>
using namespace std;
vector<int> type;
vector<int> minute;
string s;
int N;
int dp[610][60][60][2];
int func(int t, int s, int c, int dir) {
  int i;
  if (dp[t][s][c][dir] != -1) return dp[t][s][c][dir];
  if (s == c) return dp[t][s][c][dir] = minute[t];
  if (t == type.size() - 3) return dp[t][s][c][dir] = (1 << 29);
  if (type[t] == 0) {
    int ans = -(1 << 29);
    int s2;
    for (s2 = s - 1; s2 <= s + 1; s2++)
      if (s2 >= 0 && s2 < N) {
        int tmp = func(t + 1, s2, c, dir);
        ans = max(ans, tmp);
      }
    return dp[t][s][c][dir] = ans;
  }
  if (type[t] == 1 || type[t] == 3) {
    int c2 = c, dir2 = dir;
    if (dir == 0)
      c2++;
    else
      c2--;
    if (c2 == 0) dir2 = 0;
    if (c2 == N - 1) dir2 = 1;
    int ans = func(t + 1, s, c2, dir2);
    return dp[t][s][c][dir] = ans;
  }
  if (type[t] == 2) {
    int ans = func(t + 1, N, c, dir);
    return dp[t][s][c][dir] = ans;
  }
  if (type[t] == 4) {
    int ans = -(1 << 29);
    for ((i) = 0; (i) < (int)(N); (i)++) {
      int tmp = func(t + 1, i, c, dir);
      ans = max(ans, tmp);
    }
    return dp[t][s][c][dir] = ans;
  }
  return 0;
}
int main(void) {
  int i, j, k, l, S, C;
  cin >> N >> S >> C;
  S--;
  C--;
  string dir;
  cin >> dir >> dir;
  cin >> s;
  for ((i) = 0; (i) < (int)(s.length()); (i)++) {
    if (s[i] == '0') {
      for ((j) = 0; (j) < (int)(2); (j)++) minute.push_back(i);
      type.push_back(0);
      type.push_back(1);
    } else {
      for ((j) = 0; (j) < (int)(3); (j)++) minute.push_back(i);
      type.push_back(2);
      type.push_back(3);
      type.push_back(4);
    }
  }
  for ((i) = 0; (i) < (int)(610); (i)++)
    for ((j) = 0; (j) < (int)(60); (j)++)
      for ((k) = 0; (k) < (int)(60); (k)++)
        for ((l) = 0; (l) < (int)(2); (l)++) dp[i][j][k][l] = -1;
  int ans = func(0, S, C, ((dir == "tail") ? 0 : 1));
  if (ans == (1 << 29)) {
    cout << "Stowaway" << endl;
  } else {
    cout << "Controller" << ' ' << ans << endl;
  }
  return 0;
}
