#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int dx2[] = {1, -1, 0, 0, -1, 1, -1, 1};
int dy2[] = {0, 0, 1, -1, 1, -1, -1, 1};
int read() {
  int x;
  scanf("%d", &x);
  return x;
}
int a[505][505];
int main() {
  int x, y;
  x = read();
  y = read();
  int sx = read();
  int sy = read();
  string s;
  cin >> s;
  a[sx][sy] = 1;
  cout << 1 << ' ';
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == 'U') {
      int nx = sx - 1 == 0 ? 1 : sx - 1;
      int ny = sy;
      if (a[nx][ny])
        printf("0 ");
      else
        printf("1 ");
      sx = nx;
      sy = ny;
      a[nx][ny] = 1;
    } else if (s[i] == 'D') {
      int nx = sx + 1 == x + 1 ? x : sx + 1;
      int ny = sy;
      if (a[nx][ny])
        printf("0 ");
      else
        printf("1 ");
      sx = nx;
      sy = ny;
      a[nx][ny] = 1;
    } else if (s[i] == 'R') {
      int nx = sx;
      int ny = sy + 1 == y + 1 ? y : sy + 1;
      if (a[nx][ny])
        printf("0 ");
      else
        printf("1 ");
      sx = nx;
      sy = ny;
      a[nx][ny] = 1;
    } else if (s[i] == 'L') {
      int nx = sx;
      int ny = sy - 1 == 0 ? 1 : sy - 1;
      if (a[nx][ny])
        printf("0 ");
      else
        printf("1 ");
      sx = nx;
      sy = ny;
      a[nx][ny] = 1;
    }
  }
  int ans = 0;
  for (int i = 1; i <= x; i++) {
    for (int j = 1; j <= y; j++) {
      if (a[i][j] == 0) ans++;
    }
  }
  cout << ans;
  return 0;
}
