#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string cmd;
  cin >> cmd;
  x0--;
  y0--;
  vector<vector<bool> > tbl(x, vector<bool>(y));
  vector<long long> res(cmd.length() + 1);
  tbl[x0][y0] = true;
  long i = 1;
  res[0] = 1;
  long count = 1;
  for (auto &c : cmd) {
    if (c == 'U') {
      if (x0 > 0)
        x0--;
      else {
        i++;
        continue;
      }
    } else if (c == 'D') {
      if (x0 < x - 1)
        x0++;
      else {
        i++;
        continue;
      }
    } else if (c == 'L') {
      if (y0 > 0)
        y0--;
      else {
        i++;
        continue;
      }
    } else if (c == 'R') {
      if (y0 < y - 1)
        y0++;
      else {
        i++;
        continue;
      }
    }
    if (!tbl[x0][y0]) {
      count++;
      tbl[x0][y0] = true;
      res[i++] = 1;
    } else
      i++;
  }
  res[--i] += x * y - count;
  for (long i = 0; i < res.size(); i++) cout << " " + !i << res[i];
  cout << endl;
  return 0;
}
