#include <bits/stdc++.h>
using namespace std;
int xx, yy, n, m, was[600][600], cnt, ans[360000], cx, cy;
void go(char c) {
  if (c == 'U' && cx > 1) cx--;
  if (c == 'D' && cx < n) cx++;
  if (c == 'L' && cy > 1) cy--;
  if (c == 'R' && cy < m) cy++;
  return;
}
string second;
int main() {
  cin >> n >> m >> xx >> yy;
  cx = xx;
  cy = yy;
  cin >> second;
  for (int i = 0; i < second.size(); i++) {
    if (was[cx][cy] == 0) {
      ans[i]++;
      cnt++;
    }
    was[cx][cy] = 1;
    go(second[i]);
  }
  ans[second.size()] += n * m - cnt;
  for (int i = 0; i <= second.size(); i++) printf("%d ", ans[i]);
  return 0;
}
