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