#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500 * 500 + 10;
struct node {
  int x, y;
};
char str[MAXN];
node path[MAXN];
int ans[MAXN];
bool vis[505][505];
int main() {
  int n, m, x0, y0;
  scanf("%d%d%d%d", &n, &m, &x0, &y0);
  scanf("%s", str);
  int len = strlen(str);
  int nx = x0, ny = y0, sum = 0;
  for (int i = 0; i < len; i++) {
    if (vis[nx][ny])
      ans[i] = 0;
    else
      ans[i] = 1;
    vis[nx][ny] = true;
    sum += ans[i];
    path[i].x = nx;
    path[i].y = ny;
    if (str[i] == 'U') {
      nx = max(nx - 1, 1);
    } else if (str[i] == 'R') {
      ny = min(ny + 1, m);
    } else if (str[i] == 'L') {
      ny = max(ny - 1, 1);
    } else {
      nx = min(nx + 1, n);
    }
  }
  ans[len] = n * m - sum;
  for (int i = 0; i <= len; i++) {
    printf("%d%c", ans[i], i == len ? '\n' : ' ');
  }
  return 0;
}
