#include <bits/stdc++.h>
using namespace std;
int A[501][501] = {0};
int main() {
  int x, y, p, q;
  scanf("%d %d %d %d", &x, &y, &p, &q);
  string s;
  cin >> s;
  printf("1 ");
  int tests = 1;
  A[p][q] = 1;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == 'L') q = max(1, q - 1);
    if (s[i] == 'R') q = min(y, q + 1);
    if (s[i] == 'U') p = max(1, p - 1);
    if (s[i] == 'D') p = min(x, p + 1);
    if (A[p][q])
      printf("0 ");
    else {
      printf("1 ");
      tests++;
    }
    A[p][q] = 1;
  }
  printf("%d\n", x * y - tests);
  return 0;
}
