#include <bits/stdc++.h>
using namespace std;
const int MAXV = 505;
const int MAXN = 1000005;
char cad[MAXN];
bool vis[MAXV][MAXV];
int main() {
  int n, m, x, y;
  bool flag = false;
  scanf("%d %d %d %d", &n, &m, &x, &y);
  scanf("\n%s", cad);
  int x_ = x, y_ = y;
  int libres = n * m, cont = 0;
  printf("1 ");
  vis[x][y] = true;
  libres--;
  for (int i = 0; cad[i]; i++) {
    if (cad[i] == 'U')
      x--;
    else if (cad[i] == 'D')
      x++;
    else if (cad[i] == 'L')
      y--;
    else
      y++;
    if (x == 0) x = 1;
    if (x > n) x = n;
    if (y == 0) y = 1;
    if (y > m) y = m;
    if (vis[x][y] && cad[i + 1])
      printf("0 ");
    else if (!cad[i + 1])
      printf("%d ", libres);
    else
      printf("1 "), libres--;
    if (!vis[x][y]) vis[x][y] = true;
  }
  printf("\n");
  return 0;
}
