#include <bits/stdc++.h>
using namespace std;
char str[100010];
bool ans[100010], vis[510][510];
bool inmap(int nowx, int nowy, const int x, const int y) {
  if (nowx > 0 && nowy > 0 && nowx <= x && nowy <= y) {
    return 1;
  }
  return 0;
}
int main(int, char *[]) {
  int x, y, x0, y0;
  int len, i;
  scanf("%d%d%d%d", &x, &y, &x0, &y0);
  scanf("%s", str);
  len = strlen(str);
  memset(ans, 0, sizeof(ans));
  memset(vis, 0, sizeof(vis));
  ans[0] = 1;
  vis[x0][y0] = 1;
  for (i = 0; i < len; ++i) {
    switch (str[i]) {
      case 'L':
        if (inmap(x0, y0 - 1, x, y)) {
          y0--;
        }
        break;
      case 'R':
        if (inmap(x0, y0 + 1, x, y)) {
          y0++;
        }
        break;
      case 'U':
        if (inmap(x0 - 1, y0, x, y)) {
          x0--;
        }
        break;
      case 'D':
        if (inmap(x0 + 1, y0, x, y)) {
          x0++;
        }
        break;
      default:
        break;
    }
    if (vis[x0][y0] == 0) {
      ans[i + 1] = 1;
      vis[x0][y0] = 1;
    } else
      ans[i + 1] = 0;
  }
  int cnt = 0;
  for (i = 0; i < len; ++i) {
    if (i == 0)
      printf("%d", ans[i]);
    else
      printf(" %d", ans[i]);
    if (ans[i] == 1) cnt++;
  }
  printf(" %d\n", x * y - cnt);
  return 0;
}
