#include <bits/stdc++.h>
using namespace std;
bool c[555][555];
int w, h, x, y;
int CX(int x) { return min(max(x, 1), w); }
int CY(int y) { return min(max(y, 1), h); }
int main() {
  ios::sync_with_stdio(false);
  cin >> w >> h >> x >> y;
  string s;
  cin >> s;
  c[x][y] = true;
  cout << 1 << " ";
  int cnt = 1;
  for (int i = 0; i < s.size() - 1; i++) {
    char ch = s[i];
    if (ch == 'L') y = CY(y - 1);
    if (ch == 'R') y = CY(y + 1);
    if (ch == 'U') x = CX(x - 1);
    if (ch == 'D') x = CX(x + 1);
    if (!c[x][y]) {
      cout << 1 << " ";
      c[x][y] = true;
      cnt++;
    } else {
      cout << 0 << " ";
    }
  }
  cout << w * h - cnt;
  return 0;
}
