#include <bits/stdc++.h>
using namespace std;
void read_file(bool outToFile = true) {}
int n, m;
bool vis[500 + 9][500 + 9];
string s;
int l;
int x, y;
int ans[100000 + 1 + 9];
string alpha = "*URDL";
int dij[5][2] = {{0, 0}, {-1, 0}, {0, +1}, {+1, 0}, {0, -1}};
bool valid(int i, int j) { return 0 <= i && i < n && 0 <= j && j < m; }
int main() {
  read_file();
  while (scanf("%d%d", &n, &m) != EOF) {
    scanf("%d%d", &x, &y);
    x--, y--;
    memset(vis, 0, sizeof vis);
    cin >> s;
    s = "*" + s;
    l = s.length();
    for (int i = 0; i < l - 1; i++) {
      int nx, ny;
      nx = x + dij[alpha.find(s[i])][0];
      ny = y + dij[alpha.find(s[i])][1];
      if (!valid(nx, ny)) {
        ans[i] = 0;
        continue;
      }
      x = nx, y = ny;
      if (!vis[x][y]) {
        vis[x][y] = 1;
        ans[i] = 1;
      } else
        ans[i] = 0;
    }
    int cnt = n * m;
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) cnt -= vis[i][j];
    ans[l - 1] = cnt;
    for (int i = 0; i < l; i++) printf("%d%c", ans[i], " \n"[i == l - 1]);
  }
}
