#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  x0--;
  y0--;
  string s;
  cin >> s;
  vector<vector<bool> > v(x);
  for (int i = 0; i < x; ++i)
    for (int j = 0; j < y; ++j) v[i].push_back(0);
  int total = x * y;
  for (int i = 0; i < s.size(); ++i) {
    cout << !v[x0][y0] << " ";
    total -= !v[x0][y0];
    v[x0][y0] = 1;
    if (s[i] == 'L' && y0 > 0) y0--;
    if (s[i] == 'R' && y0 < y - 1) y0++;
    if (s[i] == 'U' && x0 > 0) x0--;
    if (s[i] == 'D' && x0 < x - 1) x0++;
  }
  cout << total;
  return 0;
}
