#include <bits/stdc++.h>
using namespace std;
int tx[4] = {-1, 0, 1, 0};
int ty[4] = {0, 1, 0, -1};
int n, m, x, y;
int a[1005][1005];
string S;
int main() {
  cin >> n >> m >> x >> y;
  cin >> S;
  for (int i = 0; i <= m; i++) a[0][i] = a[n + 1][i] = -1;
  for (int i = 0; i <= n; i++) a[i][0] = a[i][m + 1] = -1;
  cout << 1 << " ";
  for (int i = 0; i < S.size(); i++) {
    int vv;
    if (S[i] == 'U') vv = 0;
    if (S[i] == 'D') vv = 2;
    if (S[i] == 'R') vv = 1;
    if (S[i] == 'L') vv = 3;
    a[x][y] = 1;
    int xx = x + tx[vv];
    int yy = y + ty[vv];
    if (i == S.size() - 1) continue;
    if (a[xx][yy] < 0) {
      cout << 0 << " ";
      continue;
    }
    if (a[xx][yy] == 1) {
      cout << 0 << " ";
    } else
      cout << 1 << " ";
    x = xx;
    y = yy;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] == 0) ans++;
  cout << ans;
}
