#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  x0--;
  y0--;
  string moves;
  cin >> moves;
  vector<vector<bool> > board(x, vector<bool>(y, false));
  int dest = 0;
  int posx = x0;
  int posy = y0;
  for (int i = 0; i < moves.size(); i++) {
    if (!board[posx][posy]) {
      board[posx][posy] = 1;
      cout << "1 ";
      dest++;
    } else
      cout << "0 ";
    if (moves[i] == 'U') {
      if (posx > 0) {
        posx--;
      }
    }
    if (moves[i] == 'D') {
      if (posx < x - 1) {
        posx++;
      }
    }
    if (moves[i] == 'L') {
      if (posy > 0) posy--;
    }
    if (moves[i] == 'R') {
      if (posy < y - 1) posy++;
    }
  }
  cout << x * y - dest << endl;
}
