#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x0, y0;
  string s;
  cin >> n >> m >> x0 >> y0 >> s;
  x0--;
  y0--;
  vector<vector<int> > a = vector<vector<int> >(n, vector<int>(m, 0));
  a[x0][y0] = 1;
  for (int i = 0; i < s.size(); ++i) {
    if (a[x0][y0] == 1) {
      cout << "1 ";
    } else {
      cout << "0 ";
    }
    if (s[i] == 'U') {
      x0--;
    } else if (s[i] == 'D') {
      x0++;
    } else if (s[i] == 'L') {
      y0--;
    } else if (s[i] == 'R') {
      y0++;
    }
    x0 = max(x0, 0);
    y0 = max(y0, 0);
    x0 = min(x0, n - 1);
    y0 = min(y0, m - 1);
    a[x0][y0]++;
  }
  int others = 0;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (a[i][j] == 0) {
        others++;
      }
  if (a[x0][y0] == 1) {
    cout << others + 1;
  } else {
    cout << others;
  }
  return 0;
}
