#include <bits/stdc++.h>
using namespace std;
const int fx[4][2] = {{0, -1}, {0, 1}, {-1, 0}, {1, 0}};
map<char, int> mp;
bool f[510][510];
char st[100010];
int n, m, sx, sy, l, tot, tx, ty;
int ans[100010];
bool check(int x, int y) {
  if (0 < x && x <= n && 0 < y && y <= m)
    return true;
  else
    return false;
}
void dfs(int x, int y, int dep) {
  if (dep == l) {
    ans[l - 1] += n * m - tot;
    return;
  }
  int xx, yy;
  xx = x + fx[mp[st[dep]]][0];
  yy = y + fx[mp[st[dep]]][1];
  if (!check(xx, yy)) xx = x, yy = y;
  if (xx == x && yy == y)
    dfs(xx, yy, dep + 1);
  else if (f[xx][yy]) {
    dfs(xx, yy, dep + 1);
  } else {
    f[xx][yy] = true;
    ++tot;
    ans[dep] = 1;
    dfs(xx, yy, dep + 1);
  }
}
int main() {
  mp.clear();
  mp['L'] = 0;
  mp['R'] = 1;
  mp['U'] = 2;
  mp['D'] = 3;
  scanf("%d%d%d%d", &n, &m, &sx, &sy);
  scanf("%s", st);
  l = strlen(st);
  memset(f, 0, sizeof(f));
  memset(ans, 0, sizeof(ans));
  f[sx][sy] = true;
  tot = 1;
  dfs(sx, sy, 0);
  printf("1 ");
  for (int i = 0; i < l; ++i) printf("%d ", ans[i]);
  return 0;
}
