#include <bits/stdc++.h>
using namespace std;
const char newline = '\n';
const int dy[4] = {-1, 0, 0, 1};
const int dx[4] = {0, -1, 1, 0};
const int mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
const int N = 500 + 10;
bool visited[N][N];
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int x, y, x0, y0;
  string s;
  cin >> x >> y >> x0 >> y0;
  cin >> s;
  memset(visited, 1, sizeof(visited));
  for (int i = 0; i < s.size(); i++) {
    cout << visited[x0][y0] << ' ';
    visited[x0][y0] = 0;
    if (s[i] == 'U') {
      x0--;
    } else if (s[i] == 'D') {
      x0++;
    } else if (s[i] == 'L') {
      y0--;
    } else {
      y0++;
    }
    x0 = max(x0, 1);
    x0 = min(x0, x);
    y0 = max(y0, 1);
    y0 = min(y0, y);
  }
  int ans = 0;
  for (int i = 1; i <= x; i++) {
    for (int j = 1; j <= y; j++) {
      ans += visited[i][j];
    }
  }
  cout << ans << newline;
  return 0;
}
