#include <bits/stdc++.h>
using namespace std;
unsigned long long fact(unsigned long long n, unsigned long long m) {
  return n ? n * fact(n - 1, m) % m : 1;
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return b ? gcd(b, a % b) : a;
}
unsigned long long lcm(unsigned long long a, unsigned long long b) {
  return a / gcd(a, b) * b;
}
unsigned long long qpow(unsigned long long a, unsigned long long b,
                        unsigned long long m) {
  return b ? (b % 2 ? b : 1) * qpow(a * a % m, b / 2, m) % m : 1;
}
bool isPow2(unsigned long long x) { return !(x & (x - 1)); }
static const bool PARALLEL_MULTITEST = true;
static const bool MULTILINE_OUTPUT = true;
static const bool LAUNCH_STRESSTEST = false;
static const string INPUT_FILE = "";
static const string OUTPUT_FILE = "";
static const string DBG_INPUT_FILE = "input.txt";
static const string DBG_OUTPUT_FILE = "output.txt";
static const string DBG_ERROR_FILE = "error.txt";
struct Solver {
  long long n, m, px, py;
  string s;
  bool exploded[1000][1000];
  void readData(istream &cin) {
    cin >> n >> m >> px >> py >> s;
    --px;
    --py;
  }
  void solve(ostream &cout, ostream &cerr) {
    memset(exploded, 0, sizeof(exploded));
    long long left = n * m;
    for (char c : s) {
      if (!exploded[px][py]) {
        --left;
        exploded[px][py] = true;
        cout << "1 ";
      } else {
        cout << "0 ";
      }
      switch (c) {
        case 'U':
          --px;
          break;
        case 'D':
          ++px;
          break;
        case 'L':
          --py;
          break;
        case 'R':
          ++py;
          break;
      }
      px = min(max(px, 0LL), n - 1);
      py = min(max(py, 0LL), m - 1);
    }
    cout << left << endl;
  }
};
int main() {
  std::ios::sync_with_stdio(false);
  if (!INPUT_FILE.empty()) freopen(INPUT_FILE.c_str(), "rt", stdin);
  if (!OUTPUT_FILE.empty()) freopen(OUTPUT_FILE.c_str(), "wt", stdout);
  auto solver = Solver();
  solver.readData(cin);
  solver.solve(cout, cerr);
  return 0;
}
