#include <bits/stdc++.h>
using namespace std;
int n, cPos, hPos;
bool rightDirection;
string s;
int main() {
  cin >> n >> hPos >> cPos;
  cin >> s;
  cin >> s;
  if (s == "head") rightDirection = false;
  if (s == "tail") rightDirection = true;
  cin >> s;
  int caughtTime = -1;
  for (int i = 0; i < s.length() - 1; ++i) {
    if (s[i] == '0') {
      if (hPos > cPos)
        hPos = min(hPos + 1, n);
      else
        hPos = max(hPos - 1, 1);
      if (cPos == 1 && (rightDirection == false))
        rightDirection = true;
      else if (cPos == n && (rightDirection == true))
        rightDirection = false;
      if (rightDirection)
        cPos++;
      else
        cPos--;
    } else {
      if (cPos == 1 && (rightDirection == false))
        rightDirection = true;
      else if (cPos == n && (rightDirection == true))
        rightDirection = false;
      if (rightDirection)
        cPos++;
      else
        cPos--;
      if (cPos == 1)
        hPos = n;
      else if (cPos == n)
        hPos = 1;
      else {
        if (rightDirection)
          hPos = 1;
        else
          hPos = n;
      }
    }
    if (cPos == hPos) {
      caughtTime = i + 1;
      break;
    }
  }
  if (caughtTime == -1) {
    cout << "Stowaway";
    return 0;
  }
  cout << "Controller " << caughtTime;
  return 0;
}
