#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string s;
  cin >> s;
  int n = (int)s.length();
  set<pair<int, int>> mp;
  int prevX = x0, prevY = y0, currX = x0, currY = y0;
  cout << 1 << ' ';
  currX = x0, currY = y0;
  mp.insert({x0, y0});
  for (int i = 1; i <= n; i++) {
    int k = i;
    if (s[i - 1] == 'U')
      if (currX > 1) currX -= 1;
    if (s[i - 1] == 'D')
      if (currX < x) currX += 1;
    if (s[i - 1] == 'L')
      if (currY > 1) currY -= 1;
    if (s[i - 1] == 'R')
      if (currY < y) currY += 1;
    if (i == n) {
      int ans = x * y - (int)mp.size();
      cout << ans << endl;
    } else if (mp.find({currX, currY}) != mp.end())
      cout << 0 << ' ';
    else
      cout << 1 << ' ';
    mp.insert({currX, currY});
  }
}
