#include <bits/stdc++.h>
using namespace std;
int n, m;
char s[100000 + 10];
bool vis[512][512];
int main() {
  int x, y;
  while (scanf("%d%d%d%d", &n, &m, &x, &y) != EOF) {
    scanf("%s", s);
    int i, j;
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= m; j++) vis[i][j] = true;
    }
    int c = 0;
    for (i = 0; i < strlen(s); i++) {
      if (vis[x][y]) {
        c++;
        printf("1 ");
        vis[x][y] = false;
      } else {
        printf("0 ");
      }
      int xx, yy;
      xx = x;
      yy = y;
      if (s[i] == 'L') {
        yy--;
      } else if (s[i] == 'R') {
        yy++;
      } else if (s[i] == 'U') {
        xx--;
      } else {
        xx++;
      }
      if (xx <= 0 || xx > n || yy <= 0 || yy > m) {
        continue;
      }
      x = xx;
      y = yy;
    }
    printf("%d\n", n * m - c);
  }
  return 0;
}
