#include <bits/stdc++.h>
using namespace std;
const int ML = 100005;
const int MN = 502;
bool T[MN][MN];
char S[ML];
int main() {
  int x0, y0, x, y;
  scanf("%d %d %d %d", &x, &y, &x0, &y0);
  scanf("%s", S);
  int cnt = x * y, Sz = strlen(S);
  cnt--;
  T[x0][y0] = 1;
  printf("1 ");
  for (int i = 0; i < Sz - 1; i++) {
    int x1 = x0, y1 = y0;
    if (S[i] == 'U') x1--;
    if (S[i] == 'D') x1++;
    if (S[i] == 'R') y1++;
    if (S[i] == 'L') y1--;
    if (x1 == 0 || y1 == 0 || x1 > x || y1 > y) {
      printf("0 ");
      continue;
    }
    x0 = x1;
    y0 = y1;
    if (!T[x0][y0]) {
      printf("1 ");
      T[x0][y0] = 1;
      cnt--;
      continue;
    }
    printf("0 ");
  }
  printf("%d\n", cnt);
  return 0;
}
