#include <bits/stdc++.h>
using namespace std;
int vis[509][509];
int main() {
  int x, y, x0, y0, nx, ny;
  string s;
  cin >> x >> y >> x0 >> y0;
  cin >> s;
  int len = s.length(), ctr = 1;
  printf("1");
  vis[x0][y0] = 1;
  for (int i = 0; i < len; i++) {
    int dx = 0, dy = 0;
    if (s[i] == 'U')
      dx = -1;
    else if (s[i] == 'D')
      dx = 1;
    else if (s[i] == 'L')
      dy = -1;
    else
      dy = 1;
    nx = x0 + dx;
    ny = y0 + dy;
    if (i < len - 1) {
      if (nx >= 1 && nx <= x && ny >= 1 && ny <= y) {
        x0 = nx;
        y0 = ny;
        if (!vis[nx][ny]) {
          vis[nx][ny] = 1;
          ctr++;
          printf(" 1");
        } else
          printf(" 0");
      } else {
        printf(" 0");
      }
    }
  }
  printf(" %d", x * y - ctr);
  return 0;
}
