#include <bits/stdc++.h>
using namespace std;
int m, n, x, y;
string s;
int record[100001];
int cnt;
bool grid[502][502];
bool isIn(int x, int y) {
  if (x >= 1 && x <= m && y >= 1 && y <= n)
    return true;
  else
    return false;
}
bool isrecover(int x, int y) {
  if (grid[x][y] == 0) {
    return true;
  } else
    return false;
}
void solve() {
  if (isIn(x, y) && !isrecover(x, y)) {
    grid[x][y] = 0;
    record[0] = 1;
    cnt++;
  } else {
    record[0] = 0;
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'L') {
      y--;
      if (isIn(x, y) && !isrecover(x, y)) {
        grid[x][y] = 0;
        record[i + 1] = 1;
        cnt++;
      } else {
        record[i + 1] = 0;
        if (!isIn(x, y)) y++;
      }
    } else if (s[i] == 'R') {
      y++;
      if (isIn(x, y) && !isrecover(x, y)) {
        grid[x][y] = 0;
        record[i + 1] = 1;
        cnt++;
      } else {
        record[i + 1] = 0;
        if (!isIn(x, y)) y--;
      }
    } else if (s[i] == 'U') {
      x--;
      if (isIn(x, y) && !isrecover(x, y)) {
        grid[x][y] = 0;
        record[i + 1] = 1;
        cnt++;
      } else {
        record[i + 1] = 0;
        if (!isIn(x, y)) x++;
      }
    } else if (s[i] == 'D') {
      x++;
      if (isIn(x, y) && !isrecover(x, y)) {
        grid[x][y] = 0;
        record[i + 1] = 1;
        cnt++;
      } else {
        record[i + 1] = 0;
        if (!isIn(x, y)) x--;
      }
    }
  }
  if (record[s.length()] == 1) cnt--;
  record[s.length()] = m * n - cnt;
}
int main() {
  while (cin >> m >> n >> x >> y) {
    cin >> s;
    cnt = 0;
    memset(record, 0, sizeof(record));
    memset(grid, 1, sizeof(grid));
    solve();
    for (int i = 0; i <= s.length(); i++) cout << record[i] << " ";
    cout << endl;
  }
  return 0;
}
