#include <bits/stdc++.h>
using namespace std;
int ans[1000069], arr[569][569] = {{}};
int main() {
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string s;
  cin >> s;
  arr[x0][y0] = 1;
  for (int i = 0; i < s.length() - 1; i++) {
    if (s[i] == 'U') x0 = max(1, x0 - 1);
    if (s[i] == 'D') x0 = min(x, x0 + 1);
    if (s[i] == 'L') y0 = max(y0 - 1, 1);
    if (s[i] == 'R') y0 = min(y, y0 + 1);
    if (!arr[x0][y0]) ans[i] = 1, arr[x0][y0] = 1;
  }
  cout << 1 << " ";
  int yo = x * y;
  for (int i = 0; i < s.length() - 1; i++) cout << ans[i] << " ", yo -= ans[i];
  cout << yo - 1;
  return 0;
}
