#include <bits/stdc++.h>
using namespace std;
const int maxn = 250010;
int num[maxn];
const int maxxy = 505;
int mat[maxxy][maxxy];
int main() {
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string str;
  cin >> str;
  memset(num, 0, sizeof(num));
  memset(mat, 0xff, sizeof(mat));
  int len = str.length();
  int curx = x0, cury = y0;
  for (int i = 0; i < len; i++) {
    if (mat[curx][cury] < 0) mat[curx][cury] = i;
    if (str[i] == 'U') {
      if (curx - 1 >= 1) curx -= 1;
    } else if (str[i] == 'D') {
      if (curx + 1 <= x) curx += 1;
    } else if (str[i] == 'L') {
      if (cury - 1 >= 1) cury -= 1;
    } else {
      if (cury + 1 <= y) cury += 1;
    }
  }
  for (int i = 1; i <= x; i++) {
    for (int j = 1; j <= y; j++)
      if (mat[i][j] >= 0) num[mat[i][j]]++;
  }
  int total = 0;
  for (int i = 0; i < len; i++) {
    printf("%d ", num[i]);
    total += num[i];
  }
  cout << x * y - total << endl;
}
