#include <bits/stdc++.h>
long long mpow(long long a, long long n, long long mod) {
  long long ret = 1;
  long long b = a;
  while (n) {
    if (n & 1) ret = (ret * b) % mod;
    b = (b * b) % mod;
    n >>= 1;
  }
  return (long long)ret;
}
using namespace std;
using namespace std;
vector<int> ans;
int l, b, x, y, i, j;
bool chk(int r, int c) {
  if (r >= 1 && c >= 1 && r <= l && c <= b) return 1;
  return 0;
}
int main() {
  string s;
  cin >> l >> b >> x >> y;
  cin >> s;
  ans.resize((int)s.size() + 1);
  set<pair<int, int> > S;
  S.insert(make_pair(x, y));
  ans[0] = 1;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == 'U' && chk(x - 1, y)) {
      x--;
    }
    if (s[i] == 'D' && chk(x + 1, y)) {
      x++;
    }
    if (s[i] == 'L' && chk(x, y - 1)) {
      y--;
    }
    if (s[i] == 'R' && chk(x, y + 1)) {
      y++;
    }
    if (S.find(make_pair(x, y)) != S.end()) {
      ans[i + 1] = 0;
    } else
      ans[i + 1] = 1;
    S.insert(make_pair(x, y));
  }
  if (l * b >= s.size()) {
    ans[i] = l * b - S.size() + ans[i];
  } else {
    ans[i] = 0;
  }
  for (i = 0; i <= s.size(); i++) cout << ans[i] << " ";
  return 0;
}
