#include <bits/stdc++.h>
using namespace std;
int n, m, sum, x, y, i, viz[1001][1001];
string s;
void check(int e, int u) {
  if (e >= 1 && e <= n && u >= 1 && u <= m) x = e, y = u;
}
int j, ans[1000001];
int main() {
  cin >> n >> m >> x >> y;
  cin >> s;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) viz[i][j] = -1;
  for (i = 0; i < s.length(); i++) {
    if (viz[x][y] == -1) viz[x][y] = i;
    if (s[i] == 'L') check(x, y - 1);
    if (s[i] == 'R') check(x, y + 1);
    if (s[i] == 'U') check(x - 1, y);
    if (s[i] == 'D') check(x + 1, y);
  }
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++)
      if (viz[i][j] != -1) ans[viz[i][j]] = 1, sum++;
  ans[s.length()] = n * m - sum;
  for (i = 0; i <= s.length(); i++) cout << ans[i] << " ";
  return 0;
}
