#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {0, 0, -1, 1};
const int dy[4] = {-1, 1, 0, 0};
int i, j, x, y, n, m, e[26], b[510][510], l, ans, flag, xx, yy;
char c, s[100010];
int main() {
  scanf("%d%d%d%d", &n, &m, &x, &y);
  scanf(" %s", s);
  l = strlen(s);
  ans = 1;
  printf("1");
  e['L' - 'A'] = 0;
  e['R' - 'A'] = 1;
  e['U' - 'A'] = 2;
  e['D' - 'A'] = 3;
  memset(b, 0, sizeof(b));
  b[x][y] = 1;
  flag = 0;
  for (i = 0; i < l; i++) {
    xx = x + dx[e[s[i] - 'A']];
    yy = y + dy[e[s[i] - 'A']];
    if (flag || xx < 1 || xx > n || yy < 1 || yy > m) {
      if (i == l - 1) {
        printf(" %d\n", n * m - ans);
        continue;
      }
      printf(" 0");
      continue;
    }
    x = xx;
    y = yy;
    if (b[xx][yy] == 1) {
      if (i == l - 1) {
        printf(" %d\n", n * m - ans);
        continue;
      }
      printf(" 0");
      continue;
    }
    ans++;
    b[x][y] = 1;
    if (i == l - 1) {
      printf(" %d\n", n * m + 1 - ans);
      continue;
    }
    printf(" 1");
  }
  puts("");
  return 0;
}
