#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, x0, y0;
  int tablero[600][600];
  memset(tablero, 0, sizeof(int));
  string s;
  cin >> x >> y >> x0 >> y0;
  cin >> s;
  int ans = 1;
  cout << "1 ";
  tablero[x0][y0] = 1;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == 'U') {
      if (x0 > 1) x0--;
    }
    if (s[i] == 'D') {
      if (x0 < x) x0++;
    }
    if (s[i] == 'L') {
      if (y0 > 1) y0--;
    }
    if (s[i] == 'R') {
      if (y0 < y) y0++;
    }
    if (tablero[x0][y0] == 0) {
      cout << "1 ";
      tablero[x0][y0] = 1;
      ans++;
    } else {
      cout << "0 ";
    }
  }
  cout << (x * y) - ans << endl;
}
