#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, sx, sy;
  cin >> x >> y >> sx >> sy;
  bool tabel[x][y];
  memset(tabel, 0, sizeof(bool) * x * y);
  int mx = x * y;
  string s;
  cin >> s;
  cout << "1 ";
  mx--;
  sx--;
  sy--;
  tabel[sx][sy] = 1;
  for (int i = 0; i < s.size(); i++) {
    char c = s[i];
    if (c == 'U' && sx > 0) {
      sx--;
    }
    if (c == 'D' && sx < x - 1) {
      sx++;
    }
    if (c == 'L' && sy > 0) {
      sy--;
    }
    if (c == 'R' && sy < y - 1) {
      sy++;
    }
    if (i == s.size() - 1) {
      cout << mx << endl;
      continue;
    }
    if (!tabel[sx][sy]) {
      cout << "1 ";
      mx--;
      tabel[sx][sy] = 1;
      continue;
    }
    cout << "0 ";
  }
  cin >> mx;
}
