#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, n, m;
  string s;
  bool vis[600][600] = {0};
  int ans[200000] = {0};
  cin >> n >> m >> x >> y;
  cin >> s;
  int total = 0;
  vis[x][y] = 1;
  ans[0]++;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'U') {
      x = max(1, x - 1);
    }
    if (s[i] == 'D') {
      x = min(n, x + 1);
    }
    if (s[i] == 'L') {
      y = max(1, y - 1);
    }
    if (s[i] == 'R') {
      y = min(m, y + 1);
    }
    if (!vis[x][y]) {
      ans[i + 1]++;
      total++;
      vis[x][y] = 1;
    }
  }
  ans[s.length()] += (n * m) - total - 1;
  for (int i = 0; i <= s.length(); i++) {
    cout << ans[i];
    if (i == s.length())
      cout << "\n";
    else
      cout << " ";
  }
  return 0;
}
