#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int N = 1e5 + 5;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, x, y;
  cin >> n >> m >> x >> y;
  x--;
  y--;
  string s;
  cin >> s;
  vector<vector<int>> mat(n, vector<int>(m, -1));
  for (int i = 0; i < s.size(); i++) {
    if (mat[x][y] == -1) mat[x][y] = i;
    if (s[i] == 'U') x = max(x - 1, 0);
    if (s[i] == 'D') x = min(x + 1, n - 1);
    if (s[i] == 'R') y = min(y + 1, m - 1);
    if (s[i] == 'L') y = max(y - 1, 0);
  }
  vector<int> ans(s.size() + 1);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (mat[i][j] == -1) {
        ans[s.size()]++;
      } else {
        ans[mat[i][j]]++;
      }
    }
  }
  for (int x : ans) cout << x << ' ';
}
