#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxx = 505;
int mx[] = {-1, 1, 0, 0}, my[] = {0, 0, -1, 1};
int mapp[maxx][maxx];
char ch[100010];
int ans[100010];
int x, y, sx, sy;
int vis[maxx][maxx];
bool ck(int xx, int yy) {
  if (xx < 1 || xx > x || yy < 1 || yy > y) return 0;
  return 1;
}
int main() {
  while (~scanf("%d%d", &x, &y)) {
    scanf("%d%d", &sx, &sy);
    scanf("%s", ch);
    memset(ans, 0, sizeof(ans));
    memset(vis, 0, sizeof(vis));
    ans[0] = 1;
    memset(mapp, 0, sizeof(mapp));
    int tx = sx, ty = sy;
    vis[sx][sy] = 1;
    int xx, yy;
    for (int i = 0; ch[i]; i++) {
      if (ch[i] == 'L')
        xx = tx, yy = ty - 1;
      else if (ch[i] == 'R')
        xx = tx, yy = ty + 1;
      else if (ch[i] == 'U')
        xx = tx - 1, yy = ty;
      else if (ch[i] == 'D')
        xx = tx + 1, yy = ty;
      if (!ck(xx, yy)) continue;
      tx = xx, ty = yy;
      if (!vis[tx][ty]) mapp[tx][ty] = i + 1;
      vis[tx][ty] = 1;
    }
    int tmp = 1;
    for (int i = 1; i <= x; i++)
      for (int j = 1; j <= y; j++)
        if (mapp[i][j]) ans[mapp[i][j]]++, tmp++;
    int l = strlen(ch);
    ans[l] += x * y - tmp;
    printf("%d", ans[0]);
    for (int i = 1; i <= l; i++) printf(" %d", ans[i]);
    printf("\n");
  }
}
