#include <bits/stdc++.h>
using namespace std;
char str[100010];
int vis[510][510];
int main() {
  int x, y, x1, y1;
  scanf("%d", &x);
  scanf("%d", &y);
  scanf("%d", &x1);
  scanf("%d", &y1);
  scanf("%s", str);
  printf("1 ");
  vis[x1][y1] = 1;
  int cnt = 1, i, len = strlen(str);
  for (i = 0; i < len - 1; i++) {
    if (str[i] == 'U') {
      if (x1 == 1)
        ;
      else {
        x1--;
      }
      if (vis[x1][y1] == 1)
        printf("0 ");
      else {
        cnt++;
        printf("1 ");
      }
      vis[x1][y1] = 1;
    } else if (str[i] == 'D') {
      if (x1 == x)
        ;
      else {
        x1++;
      }
      if (vis[x1][y1] == 1)
        printf("0 ");
      else {
        cnt++;
        printf("1 ");
      }
      vis[x1][y1] = 1;
    } else if (str[i] == 'L') {
      if (y1 == 1)
        ;
      else {
        y1--;
      }
      if (vis[x1][y1] == 1)
        printf("0 ");
      else {
        cnt++;
        printf("1 ");
      }
      vis[x1][y1] = 1;
    } else {
      if (y1 == y)
        ;
      else {
        y1++;
      }
      if (vis[x1][y1] == 1)
        printf("0 ");
      else {
        cnt++;
        printf("1 ");
      }
      vis[x1][y1] = 1;
    }
  }
  printf("%d\n", x * y - cnt);
  return 0;
}
