#include <bits/stdc++.h>
using namespace std;
const long double eps = 0.000000001;
const int MAXN = 501;
int used[501][501];
int main() {
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string s;
  cin >> s;
  swap(x, y);
  swap(x0, y0);
  int dif = x * y - 1;
  map<char, pair<int, int> > m;
  used[x0][y0] = true;
  cout << 1 << ' ';
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == 'U') {
      if (y0 > 1) {
        y0--;
      }
    }
    if (s[i] == 'D') {
      if (y0 < y) {
        y0++;
      }
    }
    if (s[i] == 'L') {
      if (x0 > 1) {
        x0--;
      }
    }
    if (s[i] == 'R') {
      if (x0 < x) {
        x0++;
      }
    }
    if (i == (int)s.size() - 1) {
      cout << dif;
      break;
    }
    if (!used[x0][y0]) {
      cout << 1 << ' ';
      dif--;
      used[x0][y0] = true;
    } else
      cout << 0 << ' ';
  }
}
