#include <bits/stdc++.h>
int a[505][505];
int main() {
  int x, y, x0, y0, test;
  char c;
  while (scanf("%d %d %d %d", &x, &y, &x0, &y0) != EOF) {
    memset(a, 0, sizeof(a));
    getchar();
    a[x0][y0] = 1;
    test = x * y;
    int move = 1;
    int again = 0;
    while ((c = getchar()) != '\n') {
      if (move && !again) {
        printf("1 ");
        test--;
      } else
        printf("0 ");
      if (c == 'U') {
        if (x0 == 1)
          move = 0;
        else {
          x0 = x0 - 1;
          move = 1;
          if (a[x0][y0] == 0) {
            a[x0][y0] = 1;
            again = 0;
          } else
            again = 1;
        }
      }
      if (c == 'D') {
        if (x0 == x)
          move = 0;
        else {
          x0 = x0 + 1;
          move = 1;
          if (a[x0][y0] == 0) {
            a[x0][y0] = 1;
            again = 0;
          } else
            again = 1;
        }
      }
      if (c == 'L') {
        if (y0 == 1)
          move = 0;
        else {
          y0 = y0 - 1;
          move = 1;
          if (a[x0][y0] == 0) {
            a[x0][y0] = 1;
            again = 0;
          } else
            again = 1;
        }
      }
      if (c == 'R') {
        if (y0 == y)
          move = 0;
        else {
          y0 = y0 + 1;
          move = 1;
          if (a[x0][y0] == 0) {
            a[x0][y0] = 1;
            again = 0;
          } else
            again = 1;
        }
      }
    }
    if (move == 0)
      printf("0");
    else
      printf("%d", test);
  }
  return 0;
}
