#include <bits/stdc++.h>
void translate(char c, int *dx, int *dy) {
  switch (c) {
    case 'U':
      *dx = -1;
      *dy = 0;
      return;
    case 'R':
      *dx = 0;
      *dy = 1;
      return;
    case 'D':
      *dx = 1;
      *dy = 0;
      return;
    case 'L':
      *dx = 0;
      *dy = -1;
      return;
  }
}
int valid(int x0, int y0, int x, int y) {
  return 0 <= x0 && x0 < x && 0 <= y0 && y0 < y;
}
void solve(int x0, int y0, int x, int y) {
  char c;
  int dx, dy, step = 0,
              f[505][505] =
                  {
                      {0},
                  },
              ans = 1, empty = x * y - 1;
  f[x0][y0] = ++step;
  while (scanf("%c", &c) == 1 && c != 10) {
    printf("%d ", ans);
    ++step;
    translate(c, &dx, &dy);
    if (valid(x0 + dx, y0 + dy, x, y)) {
      x0 += dx;
      y0 += dy;
      if (!f[x0][y0]) {
        f[x0][y0] = step;
        --empty;
        ans = 1;
      } else
        ans = 0;
    } else
      ans = 0;
  }
  printf("%d", ans + empty);
}
int main(void) {
  int x, y, x0, y0;
  scanf("%d%d%d%d\n", &x, &y, &x0, &y0);
  solve(x0 - 1, y0 - 1, x, y);
  return 0;
}
