#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string s;
  cin >> s;
  int n = s.size();
  vector<vector<int>> b(x + 1, vector<int>(y + 1, 1));
  int cnt = x * y;
  for (int i = 0; i < n; i++) {
    int _x = x0, _y = y0;
    if (s[i] == 'U') _x--;
    if (s[i] == 'D') _x++;
    if (s[i] == 'R') _y++;
    if (s[i] == 'L') _y--;
    _x = max(1, _x);
    _x = min(x, _x);
    _y = max(1, _y);
    _y = min(y, _y);
    cout << b[x0][y0] << " ";
    cnt -= b[x0][y0];
    b[x0][y0] = 0;
    x0 = _x;
    y0 = _y;
  }
  cout << cnt << endl;
  return 0;
}
