#include <bits/stdc++.h>
using namespace std;
const int maxn = 505;
const int maxs = 100100;
int maxx, maxy, x, y, mask[maxn][maxn];
char cmd[maxs];
inline void init() {
  for (int idx1 = 1; idx1 <= maxx; idx1++)
    for (int idx2 = 1; idx2 <= maxy; idx2++) mask[idx1][idx2] = 1;
}
inline void mv(char ch) {
  mask[x][y] = 0;
  if (ch == 'L')
    y = max(y - 1, 1);
  else if (ch == 'R')
    y = min(y + 1, maxy);
  else if (ch == 'U')
    x = max(x - 1, 1);
  else
    x = min(x + 1, maxx);
}
inline int sum() {
  int res = 0;
  for (int idx1 = 1; idx1 <= maxx; idx1++)
    for (int idx2 = 1; idx2 <= maxy; idx2++) res += mask[idx1][idx2];
  return res;
}
int main() {
  while (scanf("%d%d%d%d%s", &maxx, &maxy, &x, &y, cmd) == 5) {
    init();
    int sidx = 0;
    while (cmd[sidx]) {
      printf("%d ", mask[x][y]);
      mv(cmd[sidx++]);
    }
    printf("%d\n", sum());
  }
  return 0;
}
