#include <bits/stdc++.h>
using namespace std;
const int MAX = 510, LEN = 100010;
int main() {
  int n, m, xo, yo, grid[MAX][MAX];
  scanf("%d%d%d%d", &n, &m, &xo, &yo);
  xo--;
  yo--;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) grid[i][j] = 0;
  char cmd[LEN];
  scanf(" %s", cmd);
  int x = xo, y = yo;
  for (int i = 0, len = strlen(cmd); i < len; i++) {
    if (!grid[x][y]) {
      printf("1 ");
      grid[x][y] = 1;
    } else {
      printf("0 ");
    }
    if (cmd[i] == 'U' && x > 0) x--;
    if (cmd[i] == 'D' && x < n - 1) x++;
    if (cmd[i] == 'L' && y > 0) y--;
    if (cmd[i] == 'R' && y < m - 1) y++;
  }
  int cnt = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (!grid[i][j]) cnt++;
  printf("%d\n", cnt);
  return 0;
}
