#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
int a[100005];
int c[100005];
int vis[505][505];
int v[505][505];
int main() {
  int n, m, x, y;
  cin >> n >> m >> x >> y;
  int a = x, b = y;
  string s;
  cin >> s;
  int res = n * m;
  int lx = 0, ly = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'U' && x - 1 >= 1) {
      x--;
      if (!vis[x][y]) lx = x, ly = y;
      vis[x][y]++;
    }
    if (s[i] == 'D' && x + 1 <= n) {
      x++;
      if (!vis[x][y]) lx = x, ly = y;
      vis[x][y]++;
    }
    if (s[i] == 'L' && y - 1 >= 1) {
      y--;
      if (!vis[x][y]) lx = x, ly = y;
      vis[x][y]++;
    }
    if (s[i] == 'R' && y + 1 <= m) {
      y++;
      if (!vis[x][y]) lx = x, ly = y;
      vis[x][y]++;
    }
  }
  x = a, y = b;
  for (int i = 0; i < s.length(); i++) {
    if (!v[x][y]) {
      res--;
      printf("1 ");
    } else
      printf("0 ");
    v[x][y]++;
    if (s[i] == 'U')
      if (x - 1 >= 1) x--;
    if (s[i] == 'D')
      if (x + 1 <= n) x++;
    if (s[i] == 'L')
      if (y - 1 >= 1) y--;
    if (s[i] == 'R')
      if (y + 1 <= m) y++;
  }
  printf("%d", res);
  puts("");
  return 0;
}
