#include <bits/stdc++.h>
using namespace std;
const int maxlen = 100000 + 5;
const int maxx = 500 + 5;
char s[maxlen];
int ans[maxlen], vis[maxx][maxx];
int main() {
  int x, y, x0, y0;
  scanf("%d%d%d%d%s", &x, &y, &x0, &y0, s);
  x0--, y0--;
  int n = strlen(s);
  memset(vis, -1, sizeof vis);
  vis[x0][y0] = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'L')
      y0--;
    else if (s[i] == 'R')
      y0++;
    else if (s[i] == 'U')
      x0--;
    else
      x0++;
    if (x0 >= x) x0 = x - 1;
    if (x0 < 0) x0 = 0;
    if (y0 >= y) y0 = y - 1;
    if (y0 < 0) y0 = 0;
    if (vis[x0][y0] == -1)
      vis[x0][y0] = i + 1;
    else
      vis[x0][y0] = min(vis[x0][y0], i + 1);
  }
  memset(ans, 0, sizeof ans);
  for (int i = 0; i < x; i++)
    for (int j = 0; j < y; j++)
      if (vis[i][j] == -1)
        ans[n]++;
      else
        ans[vis[i][j]]++;
  for (int i = 0; i <= n; i++) printf("%d%c", ans[i], i == n ? '\n' : ' ');
}
