#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
bool vis[550][550];
int main() {
  int n, m, x, y;
  string s;
  cin >> n >> m >> x >> y;
  cin >> s;
  memset(vis, false, sizeof(vis));
  int cnt = 1;
  ans.push_back(1);
  vis[x][y] = true;
  for (int i = 0; i < s.size() - 1; i++) {
    int xx = x, yy = y;
    if (s[i] == 'U')
      xx--;
    else if (s[i] == 'D')
      xx++;
    else if (s[i] == 'L')
      yy--;
    else if (s[i] == 'R')
      yy++;
    if (xx >= 1 && xx <= n && yy >= 1 && yy <= m) {
      x = xx;
      y = yy;
    }
    if (vis[x][y])
      ans.push_back(0);
    else {
      ans.push_back(1);
      vis[x][y] = true;
      cnt++;
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  cout << n * m - cnt << endl;
  return 0;
}
