#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, x0, y0;
  cin >> m >> n >> x0 >> y0;
  int x = x0, y = y0, mines = 1;
  char str[100005];
  int visited[505][505] = {0};
  scanf("%s", str);
  int len = strlen(str);
  printf("1 ");
  visited[x0][y0] = 1;
  for (int i = 0; i < len - 1; ++i) {
    if (str[i] == 'U') {
      if (x - 1 >= 1 && visited[x - 1][y] == 0) {
        printf("1 ");
        x = x - 1;
        ++mines;
        visited[x][y] = 1;
      } else {
        printf("0 ");
        if (x - 1 >= 1) x = x - 1;
      }
    } else if (str[i] == 'D') {
      if (x + 1 <= m && visited[x + 1][y] == 0) {
        printf("1 ");
        x = x + 1;
        ++mines;
        visited[x][y] = 1;
      } else {
        printf("0 ");
        if (x + 1 <= m) x = x + 1;
      }
    } else if (str[i] == 'L') {
      if (y - 1 >= 1 && visited[x][y - 1] == 0) {
        printf("1 ");
        y = y - 1;
        ++mines;
        visited[x][y] = 1;
      } else {
        printf("0 ");
        if (y - 1 >= 1) y = y - 1;
      }
    } else if (str[i] == 'R') {
      if (y + 1 <= n && visited[x][y + 1] == 0) {
        printf("1 ");
        y = y + 1;
        ++mines;
        visited[x][y] = 1;
      } else {
        printf("0 ");
        if (y + 1 <= n) y = y + 1;
      }
    }
  }
  printf("%d\n", m * n - mines);
  return 0;
}
