#include <bits/stdc++.h>
using namespace std;
int a[1000][1000];
int main() {
  int x, y, sx, sy, i, j;
  cin >> x >> y >> sx >> sy;
  string s;
  cin >> s;
  memset(a, 0, sizeof(a));
  for (i = 0; i < s.size(); i++) {
    if (!a[sx][sy]) {
      printf("1 ");
      a[sx][sy] = 1;
    } else
      printf("0 ");
    a[sx][sy] = 1;
    if (s[i] == 'U') {
      if (sx - 1 > 0) sx--;
    }
    if (s[i] == 'R') {
      if (sy + 1 <= y) sy++;
    }
    if (s[i] == 'D') {
      if (sx + 1 <= x) sx++;
    }
    if (s[i] == 'L') {
      if (sy - 1 > 0) sy--;
    }
  }
  int cnt = 0;
  for (i = 1; i <= x; i++) {
    for (j = 1; j <= y; j++)
      if (a[i][j] == 0) cnt++;
  }
  printf("%d\n", cnt);
  return 0;
}
