#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, px, py, countf;
  cin >> x >> y >> px >> py;
  countf = x * y;
  bool occupied[x + 1][y + 1];
  for (int i = 1; i <= x; i++) {
    for (int j = 1; j <= y; j++) occupied[i][j] = false;
  }
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (!occupied[px][py]) {
      occupied[px][py] = true;
      countf--;
      cout << "1 ";
    } else
      cout << "0 ";
    if (s[i] == 'U')
      px = max(1, px - 1);
    else if (s[i] == 'R')
      py = min(y, py + 1);
    else if (s[i] == 'L')
      py = max(1, py - 1);
    else if (s[i] == 'D')
      px = min(x, px + 1);
  }
  cout << countf << endl;
  return 0;
}
