#include <bits/stdc++.h>
using namespace std;
int len, x, y, curx, cury, g[510][510], a[100010];
string s;
bool isvalid(int x0, int y0) {
  if (x0 <= x && x0 >= 1 && y0 <= y && y0 >= 1) return true;
  return false;
}
void calc(char ch) {
  int i, j, k, x, y, ans;
  x = curx;
  y = cury;
  if (ch == 'L') {
    if (isvalid(x, y - 1)) {
      curx = x;
      cury = y - 1;
    }
  } else if (ch == 'R') {
    if (isvalid(x, y + 1)) {
      curx = x;
      cury = y + 1;
    }
  } else if (ch == 'U') {
    if (isvalid(x - 1, y)) {
      curx = x - 1;
      cury = y;
    }
  } else {
    if (isvalid(x + 1, y)) {
      curx = x + 1;
      cury = y;
    }
  }
}
int main() {
  int i, j, k, x0, y0, d = 0, ans;
  scanf("%d%d%d%d", &x, &y, &x0, &y0);
  cin >> s;
  len = s.length();
  curx = x0;
  cury = y0;
  for (i = 0; i <= 501; i++)
    for (j = 0; j <= 501; j++) g[i][j] = 0;
  for (i = 0; i < len; i++) {
    ans = 0;
    if (g[curx][cury] == 0) {
      ans = 1;
      d += 1;
      g[curx][cury] = 1;
    }
    calc(s[i]);
    a[i] = ans;
  }
  a[len] = x * y - d;
  for (i = 0; i <= len; i++) printf("%d ", a[i]);
  printf("\n");
  return 0;
}
