#include <bits/stdc++.h>
using namespace std;
char op[100000 + 5];
int ans[100000 + 5];
int vis[500 + 5][500 + 5];
int n, m;
void change(char c, int &x, int &y) {
  int tx, ty;
  tx = x, ty = y;
  if (c == 'L') y--;
  if (c == 'R') y++;
  if (c == 'U') x--;
  if (c == 'D') x++;
  if (x < 1 || x > n || y < 1 || y > m) x = tx, y = ty;
}
int main() {
  int sx, sy;
  while (scanf("%d%d%d%d", &n, &m, &sx, &sy) != EOF) {
    memset(vis, 0, sizeof(vis));
    scanf("%s", op);
    int len = strlen(op);
    int cnt = 1;
    ans[0] = 1;
    vis[sx][sy] = 1;
    for (int i = 0; i < len; i++) {
      change(op[i], sx, sy);
      if (vis[sx][sy])
        ans[i + 1] = 0;
      else
        cnt++, vis[sx][sy] = 1, ans[i + 1] = 1;
    }
    if (ans[len] == 1)
      ans[len] = n * m - cnt + 1;
    else
      ans[len] = n * m - cnt;
    for (int i = 0; i <= len; i++) {
      printf("%d", ans[i]);
      if (i == len)
        printf("\n");
      else
        printf(" ");
    }
  }
  return 0;
}
