#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, s[505][505], len;
int ans[100005];
char cmd[100005];
int main() {
  scanf("%d %d %d %d %s", &a, &b, &c, &d, cmd);
  len = strlen(cmd);
  ans[0] = 1;
  ans[len] = a * b - 1;
  s[c][d] = 1;
  for (int i = (0); i <= (len - 1); i++) {
    if (cmd[i] == 'L') d = max(1, d - 1);
    if (cmd[i] == 'R') d = min(b, d + 1);
    if (cmd[i] == 'U') c = max(1, c - 1);
    if (cmd[i] == 'D') c = min(a, c + 1);
    if (!s[c][d]) s[c][d] = 1, ans[i + 1]++, ans[len]--;
  }
  for (int i = (0); i <= (len); i++)
    printf("%d%c", ans[i], i == len ? '\n' : ' ');
  return 0;
}
