#include <bits/stdc++.h>
using namespace std;
int r, c, x, y;
char s[111111];
int mat[555][555];
int main(void) {
  cin >> r >> c >> x >> y;
  cin >> s;
  int ans = r * c;
  ans--;
  printf("1 ");
  mat[x][y] = 1;
  for (int i = 0; i < strlen(s) - 1; i++) {
    int tx = x, ty = y;
    if (s[i] == 'L') {
      ty--;
    } else if (s[i] == 'R') {
      ty++;
    } else if (s[i] == 'U') {
      tx--;
    } else {
      tx++;
    }
    if (tx >= 1 && tx <= r && ty >= 1 && ty <= c) {
      if (mat[tx][ty] == 0) {
        printf("1 ");
        mat[tx][ty] = 1;
        ans--;
      } else {
        printf("0 ");
      }
      x = tx;
      y = ty;
    } else {
      printf("0 ");
    }
  }
  cout << ans;
  return 0;
}
