#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const long long BINF = (long long)1e18;
const int N = 501;
int n, m, x, y;
bool used[N][N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n >> m;
  cin >> x >> y;
  string s;
  cin >> s;
  int ans[100001];
  int cnt = (n * m);
  for (int i = 0; i < s.size(); ++i) {
    if (!used[x][y]) {
      --cnt;
      ans[i] = 1;
    } else {
      ans[i] = 0;
    }
    used[x][y] = 1;
    if (s[i] == 'L') {
      --y;
      if (!y) {
        ++y;
      }
    }
    if (s[i] == 'R') {
      ++y;
      if (!(y - m - 1)) {
        --y;
      }
    }
    if (s[i] == 'U') {
      --x;
      if (!x) {
        ++x;
      }
    }
    if (s[i] == 'D') {
      ++x;
      if (!(x - n - 1)) {
        --x;
      }
    }
  }
  ans[s.size()] = cnt;
  for (int i = 0; i <= s.size(); ++i) {
    cout << ans[i] << " ";
  }
  return 0;
}
