#include <bits/stdc++.h>
using namespace std;
const int maxn = 505;
int vis[maxn][maxn];
int n, m, x, y;
char s[maxn * 10000];
vector<int> ans;
int nx, ny;
int in(int ex, int ey) {
  if (ex < 1 || ey < 1 || ex > n || ey > m) return 0;
  return 1;
}
void Move(char c) {
  int xx = nx, yy = ny;
  if (c == 'U') nx = nx - 1;
  if (c == 'D') nx = nx + 1;
  if (c == 'L') ny = ny - 1;
  if (c == 'R') ny = ny + 1;
  if (!in(nx, ny)) {
    nx = xx;
    ny = yy;
  }
  if (vis[nx][ny])
    ans.push_back(0);
  else {
    vis[nx][ny] = 1;
    ans.push_back(1);
  }
}
void solve() {
  memset(vis, 0, sizeof(vis));
  ans.clear();
  int len = strlen(s);
  nx = x, ny = y;
  ans.push_back(1);
  vis[nx][ny] = 1;
  for (int i = 0; i < len - 1; i++) {
    Move(s[i]);
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) cnt += vis[i][j];
  }
  ans.push_back(n * m - cnt);
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  printf("\n");
}
int main() {
  while (scanf("%d %d %d %d", &n, &m, &x, &y) != EOF) {
    scanf("%s", s);
    solve();
  }
  return 0;
}
