#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b) {
  long long int res = 1;
  a = a % 1000000007;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
      b--;
    }
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, k;
  cin >> n >> m >> k;
  string s11, s12, s2;
  cin >> s11 >> s12 >> s2;
  long long int minute = -1;
  for (int i = 0; i < s2.size(); ++i) {
    if (s2[i] == '1') {
      minute = i + 1;
      break;
    }
  }
  long long int maxx;
  bool dir;
  if (s12 == "head") {
    if (m < k) {
      if (minute <= k - 1) {
        m = n;
        if (minute == k - 1) {
          dir = 1;
          k = 1;
        } else {
          dir = 0;
          k -= minute;
        }
      } else {
        cout << "Controller " << k - 1;
        exit(0);
      }
    } else {
      if (minute <= k - 1 + n - 1) {
        if (minute == k - 1 + n - 1) {
          m = 1;
          dir = 0;
          k = n;
        } else {
          if (minute < k - 1)
            dir = 0, k -= minute, m = n;
          else {
            dir = 1, k = 1 + minute - k + 1;
            if (minute == k - 1)
              m = n;
            else
              m = 1;
          }
        }
      } else {
        cout << "Controller " << k - 1 + n - 1;
        exit(0);
      }
    }
  } else {
    if (m < k) {
      if (minute <= n - k + n - 1) {
        if (minute == n - k + n - 1)
          dir = 1, k = 1, m = n;
        else {
          if (minute < n - k)
            dir = 1, k += minute, m = 1;
          else {
            dir = 0, k = n - (minute - (n - k));
            if (minute == n - k)
              m = 1;
            else
              m = n;
          }
        }
      } else {
        cout << "Controller " << n - k + n - 1;
        exit(0);
      }
    } else {
      if (minute <= n - k) {
        m = 1;
        if (minute == n - k)
          dir = 0, k = n;
        else
          k += minute, dir = 1;
      } else {
        cout << "Controller " << n - k;
        exit(0);
      }
    }
  }
  vector<long long int> move;
  long long int j = minute;
  for (int i = minute; i < s2.size(); ++i) {
    if (s2[i] == '1') {
      move.push_back(i - j + 1);
      j = i + 1;
    }
  }
  for (auto i : move) {
    if (dir == 0) {
      if (m < k) {
        if (i <= k - 1) {
          m = n;
          if (i == k - 1) {
            dir = 1;
            k = 1;
          } else {
            dir = 0;
            k -= i;
          }
          minute += i;
        } else {
          cout << "Controller " << minute + k - 1;
          exit(0);
        }
      } else {
        if (i <= k - 1 + n - 1) {
          if (i == k - 1 + n - 1) {
            dir = 0;
            k = n;
            m = 1;
          } else {
            if (i < k - 1)
              dir = 0, k -= i, m = n;
            else {
              dir = 1, k = 1 + i - k + 1;
              if (i == k - 1)
                m = n;
              else
                m = 1;
            }
          }
          minute += i;
        } else {
          cout << "Controller " << minute + k - 1 + n - 1;
          exit(0);
        }
      }
    } else {
      if (m < k) {
        if (i <= n - k + n - 1) {
          if (i == n - k + n - 1)
            dir = 1, k = 1, m = n;
          else {
            if (i < n - k)
              dir = 1, k += i, m = 1;
            else {
              dir = 0, k = n - (i - (n - k));
              if (i == n - k)
                m = 1;
              else
                m = n;
            }
          }
          minute += i;
        } else {
          cout << "Controller " << minute + n - k + n - 1;
          exit(0);
        }
      } else {
        if (i <= n - k) {
          m = 1;
          if (i == n - k)
            dir = 0, k = n;
          else
            k += i, dir = 1;
          minute += i;
        } else {
          cout << "Controller " << minute + n - k;
          exit(0);
        }
      }
    }
  }
  cout << "Stowaway";
}
