#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int x, y, x0, y0;
  scanf("%d%d%d%d\n", &x, &y, &x0, &y0);
  bool g[501][501] = {};
  char str[100005];
  int ans[100005] = {};
  scanf("%s", str);
  int n = strlen(str);
  int i;
  int used = 1;
  g[x0][y0] = 1;
  int xx, yy;
  xx = x0;
  yy = y0;
  int total = 1;
  for (i = 0; i < n - 1; i++) {
    if (str[i] == 'L') {
      if (yy - 1 >= 1) {
        yy--;
      } else {
        ans[i] = 0;
        continue;
      }
    } else if (str[i] == 'R') {
      if (yy + 1 <= y) {
        yy++;
      } else {
        ans[i] = 0;
        continue;
      }
    } else if (str[i] == 'U') {
      if (xx - 1 >= 1) {
        xx--;
      } else {
        ans[i] = 0;
        continue;
      }
    } else {
      if (xx + 1 <= x) {
        xx++;
      } else {
        ans[i] = 0;
        continue;
      }
    }
    if (g[xx][yy] == 0) {
      ans[i] = 1;
      g[xx][yy] = 1;
      total++;
    } else {
      ans[i] = 0;
    }
  }
  ans[n - 1] = x * y - total;
  printf("1 ");
  for (i = 0; i < n; i++) {
    printf("%d", ans[i]);
    if (i != n - 1) printf(" ");
  }
  return 0;
}
