#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
const int N = 100007;
char s[N];
int main() {
  int x, y, x0, y0, vis[600][600];
  scanf("%d %d %d %d", &x, &y, &x0, &y0);
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  for (int i = 1; i <= 500; i++) {
    for (int j = 1; j <= 500; j++) vis[i][j] = 1;
  }
  printf("%d", vis[x0][y0]);
  vis[x0][y0] = 0;
  int cnt = 1;
  for (int i = 1; i <= len; i++) {
    if (s[i] == 'U' && x0 - 1 >= 1)
      x0 -= 1;
    else if (s[i] == 'D' && x0 + 1 <= x)
      x0 += 1;
    else if (s[i] == 'L' && y0 - 1 >= 1)
      y0 -= 1;
    else if (s[i] == 'R' && y0 + 1 <= y)
      y0 += 1;
    if (i != len) printf(" %d", vis[x0][y0]);
    if (vis[x0][y0] == 1 && i != len) {
      vis[x0][y0] = 0;
      cnt++;
    }
  }
  printf(" %d\n", x * y - cnt);
  return 0;
}
