#include <bits/stdc++.h>
using namespace std;
int vis[501][501];
int ans[1000001];
int main() {
  std::ios_base::sync_with_stdio(false);
  int x, y, cx, cy, dis = 1;
  string s;
  cin >> x >> y >> cx >> cy >> s;
  vis[cx][cy] = 1;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'U')
      cx = max(cx - 1, 1);
    else if (s[i] == 'D')
      cx = min(cx + 1, x);
    else if (s[i] == 'L')
      cy = max(cy - 1, 1);
    else
      cy = min(cy + 1, y);
    if (!vis[cx][cy]) {
      vis[cx][cy] = 1;
      ans[i + 1] = 1;
      dis++;
    }
  }
  ans[0] = 1;
  ans[s.length()] += (x * y - dis);
  for (int i = 0; i < s.length() + 1; i++) cout << ans[i] << " ";
  return 0;
}
