#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e3;
int d[N][N];
bool normally(int x, int y, int n, int m) {
  return (1 <= x && x <= n && 1 <= y && y <= m);
}
int main() {
  int x, y, X, Y;
  cin >> x >> y >> X >> Y;
  int rperopewow, reorpweorp;
  rperopewow = X;
  reorpweorp = Y;
  string a;
  cin >> a;
  int n = a.size();
  vector<int> ans(n + 1);
  d[X][Y] = 1;
  for (int i = 0; i < n; ++i) {
    if (a[i] == 'L' && normally(X, Y - 1, x, y))
      --Y;
    else if (a[i] == 'R' && normally(X, Y + 1, x, y))
      ++Y;
    else if (a[i] == 'U' && normally(X - 1, Y, x, y))
      --X;
    else if (a[i] == 'D' && normally(X + 1, Y, x, y))
      ++X;
    if (d[X][Y] == 0) d[X][Y] = i + 2;
  }
  for (int i = 1; i <= x; ++i) {
    for (int j = 1; j <= y; ++j) {
      cerr << d[i][j];
      cerr << ' ';
    }
    cout << endl;
  }
  for (int i = 1; i <= x; ++i) {
    for (int j = 1; j <= y; ++j) {
      if (d[i][j] == 0)
        ans[n]++;
      else
        ans[d[i][j] - 1]++;
    }
  }
  for (int i = 0; i <= n; ++i) cout << ans[i] << ' ';
  return 0;
}
