#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int inf = mod;
int x, y, x0, asdasfg, n, ans, i;
bool H[505][505];
char str[N];
int main() {
  scanf("%d %d %d %d", &x, &y, &x0, &asdasfg);
  scanf("%s", str);
  n = strlen(str);
  for (i = 0; i < n; i++) {
    if (!H[x0][asdasfg]) {
      printf("1 ");
      ans++;
      H[x0][asdasfg] = 1;
    } else
      printf("0 ");
    if (str[i] == 'U')
      if (x0 - 1 >= 1) x0--;
    if (str[i] == 'R')
      if (asdasfg + 1 <= y) asdasfg++;
    if (str[i] == 'L')
      if (asdasfg - 1 >= 1) asdasfg--;
    if (str[i] == 'D')
      if (x0 + 1 <= x) x0++;
  }
  printf("%d", x * y - ans);
}
