#include <bits/stdc++.h>
using namespace std;
bool mark[555][555];
char s[111111];
int x, y, m, n, res;
int main() {
  scanf("%d%d%d%d", &m, &n, &x, &y);
  scanf("%s", s);
  int len = strlen(s);
  printf("1 ");
  mark[x][y] = 1;
  int cnt = 1;
  for (int i = 0; i < len; ++i) {
    bool ok = 0;
    if (s[i] == 'U' && x > 1)
      --x, ok = 1;
    else if (s[i] == 'D' && x < m)
      ++x, ok = 1;
    else if (s[i] == 'L' && y > 1)
      --y, ok = 1;
    else if (s[i] == 'R' && y < n)
      ++y, ok = 1;
    if (!mark[x][y])
      mark[x][y] = 1, ++cnt;
    else
      ok = 0;
    if (i < len - 1) {
      if (!ok)
        printf("0 ");
      else
        printf("1 ");
    } else {
      int res = m * n - cnt;
      if (ok) ++res;
      printf("%d\n", res);
    }
  }
}
