#include <bits/stdc++.h>
using namespace std;
int A[510][510] = {0};
char s[100000 + 10];
;
int main() {
  int n, m, x, y;
  scanf("%d%d%d%d", &n, &m, &x, &y);
  scanf("%s", s);
  int i, j, k, l = strlen(s);
  int sum = 1;
  printf("1 ");
  A[x][y] = 1;
  int xc = x, yc = y;
  for (i = 0; i < l - 1; i++) {
    if (s[i] == 'U') {
      if (xc > 1) xc--;
    }
    if (s[i] == 'D')
      if (xc < n) xc++;
    if (s[i] == 'L')
      if (yc > 1) yc--;
    if (s[i] == 'R')
      if (yc < m) yc++;
    if (A[xc][yc])
      printf("0 ");
    else {
      printf("1 ");
      A[xc][yc] = 1;
      sum++;
    }
  }
  printf("%d", n * m - sum);
  return 0;
}
