#include <bits/stdc++.h>
const int MAX_N = (int)1e5 + 123;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;
using namespace std;
int n, m;
int x, y;
map<char, pair<int, int> > to;
void init() {
  to['L'] = make_pair(0, -1);
  to['R'] = make_pair(0, 1);
  to['U'] = make_pair(-1, 0);
  to['D'] = make_pair(1, 0);
}
string second;
vector<pair<pair<int, int>, int> > q;
map<pair<int, int>, bool> u;
int main() {
  cin >> n >> m >> x >> y;
  init();
  cin >> second;
  q.push_back(make_pair(make_pair(x, y), 1));
  int cnt = 1;
  for (auto i : second) {
    pair<int, int> now = to[i];
    if (x + now.first > 0 && x + now.first <= n && y + now.second > 0 &&
        y + now.second <= m)
      x += now.first, y += now.second, cnt++;
    q.push_back(make_pair(make_pair(x, y), cnt));
  }
  for (int i = 0; i < int((q).size()); i++) {
    int ans = 0;
    if (!u[q[i].first]) ans++;
    u[q[i].first] = 1;
    if (i == int((q).size()) - 1) {
      for (int j = 1; j <= n; j++)
        for (int k = 1; k <= m; k++)
          if (!u[make_pair(j, k)]) ans++;
    }
    cout << ans << ' ';
  }
  return 0;
}
