#include <bits/stdc++.h>
int main() {
  int x1, y1, x0, y0, i, l, t = 1;
  int g[510][510] = {0};
  scanf("%d%d%d%d", &x1, &y1, &x0, &y0);
  char s[100001];
  scanf("%s", s);
  l = strlen(s);
  printf("1 ");
  g[x0][y0] = 1;
  for (i = 0; i <= l - 1; i++) {
    if (i != l - 1) {
      if (s[i] == 'U') {
        if (x0 == 1)
          printf("0 ");
        else if (g[x0 - 1][y0] == 1) {
          x0 = x0 - 1;
          printf("0 ");
        } else {
          x0 = x0 - 1;
          g[x0][y0] = 1;
          t++;
          printf("1 ");
        }
      }
      if (s[i] == 'D') {
        if (x0 == x1)
          printf("0 ");
        else if (g[x0 + 1][y0] == 1) {
          x0 = x0 + 1;
          printf("0 ");
        } else {
          x0 = x0 + 1;
          g[x0][y0] = 1;
          t++;
          printf("1 ");
        }
      }
      if (s[i] == 'L') {
        if (y0 == 1)
          printf("0 ");
        else if (g[x0][y0 - 1] == 1) {
          y0 = y0 - 1;
          printf("0 ");
        } else {
          y0 = y0 - 1;
          g[x0][y0] = 1;
          t++;
          printf("1 ");
        }
      }
      if (s[i] == 'R') {
        if (y0 == y1)
          printf("0 ");
        else if (g[x0][y0 + 1] == 1) {
          y0 = y0 + 1;
          printf("0 ");
        } else {
          y0 = y0 + 1;
          t++;
          g[x0][y0] = 1;
          printf("1 ");
        }
      }
    } else
      printf("%d", x1 * y1 - t);
  }
}
