#include <bits/stdc++.h>
using namespace std;
char s[100000];
int n, m, x, y, i, sol, v[501][501];
int main() {
  cin >> n >> m >> x >> y;
  cin >> s;
  cout << 1 << " ";
  int l = strlen(s);
  for (i = 0; i < l - 1; i++) {
    v[x][y] = 1;
    if (s[i] == 'R' && y < m) y++;
    if (s[i] == 'L' && y > 1) y--;
    if (s[i] == 'U' && x > 1) x--;
    if (s[i] == 'D' && x < n) x++;
    if (v[x][y] == 1)
      cout << 0 << " ";
    else {
      cout << 1 << " ";
      sol++;
    }
  }
  cout << n * m - sol - 1;
  return 0;
}
