#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, a, b;
  cin >> n >> m >> a >> b;
  string s;
  cin >> s;
  int tot = n * m - 1;
  set<pair<int, int> > vis;
  vis.insert(make_pair(a, b));
  cout << "1 ";
  for (int i = 0; i < (int)s.length() - 1; i++) {
    if (s[i] == 'U' && a > 1)
      a--;
    else if (s[i] == 'D' && a < n)
      a++;
    else if (s[i] == 'L' && b > 1)
      b--;
    else if (s[i] == 'R' && b < m)
      b++;
    int cur = !vis.count(make_pair(a, b));
    vis.insert(make_pair(a, b));
    tot -= cur;
    cout << cur << " ";
  }
  cout << tot << "\n";
}
