#include <bits/stdc++.h>
using namespace std;
bool v[510][510];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string s;
  cin >> s;
  int m = x * y;
  --m;
  v[x0][y0] = true;
  cout << 1 << " ";
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == 'U') x0 = max(1, x0 - 1);
    if (s[i] == 'D') x0 = min(x0 + 1, x);
    if (s[i] == 'L') y0 = max(1, y0 - 1);
    if (s[i] == 'R') y0 = min(y0 + 1, y);
    if (v[x0][y0] == false) {
      --m;
      v[x0][y0] = true;
      cout << 1 + (i + 1 == s.size() ? m : 0) << " ";
    } else
      cout << 0 + (i + 1 == s.size() ? m : 0) << " ";
  }
  cout << endl;
  return 0;
}
