#include <bits/stdc++.h>
using namespace std;
int ar[609][609];
int res[1000009];
int main() {
  ios::sync_with_stdio(false);
  int x, y, a, b;
  cin >> x >> y >> a >> b;
  a--;
  b--;
  int pos = 0;
  res[pos++] = 1;
  string s;
  cin >> s;
  ar[a][b] = 1;
  int cnt = 1;
  for (int i = 0; i < (s.length()); i++) {
    if (s[i] == 'U') {
      if (a > 0) {
        a -= 1;
      }
    }
    if (s[i] == 'D') {
      if (a < x - 1) {
        a += 1;
      }
    }
    if (s[i] == 'R') {
      if (b < y - 1) {
        b += 1;
      }
    }
    if (s[i] == 'L') {
      if (b > 0) {
        b -= 1;
      }
    }
    if (ar[a][b]) {
      res[pos++] = 0;
    } else {
      ar[a][b] = 1;
      res[pos++] = 1;
      cnt += 1;
    }
  }
  cnt = (x * y) - cnt;
  res[s.length()] += cnt;
  for (int i = 0; i < (s.length() + 1); i++) {
    cout << res[i] << " ";
  }
  cout << endl;
  return 0;
}
