#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 5;
const long long int M = 1e18;
long long int visit[505][505], a[505][505];
vector<pair<long long int, long long int> > v;
int main() {
  long long int x, y, x0, y0, i, j, cnt, ans;
  cin >> x >> y >> x0 >> y0;
  string s;
  visit[x0][y0] = 1;
  cin >> s;
  a[x0][y0] = 1;
  v.push_back(make_pair(x0, y0));
  for (i = 0, cnt = 0; i < int(s.size()); i++) {
    if (s[i] == 'U') {
      if (x0 > 1) x0--, cnt++;
      a[x0][y0]++;
    } else if (s[i] == 'D') {
      if (x0 < x) x0++, cnt++;
      a[x0][y0]++;
    } else if (s[i] == 'R') {
      if (y0 < y) y0++, cnt++;
      a[x0][y0]++;
    } else {
      if (y0 > 1) y0--, cnt++;
      a[x0][y0]++;
    }
    v.push_back(make_pair(x0, y0));
  }
  cout << "1 ";
  for (i = 1; i < int(v.size()); i++) {
    if (!visit[v[i].first][v[i].second]) {
      visit[v[i].first][v[i].second] = 1;
      ans = 1;
    } else
      ans = 0;
    if (i != int(v.size()) - 1) cout << ans << " ";
  }
  visit[v[int(v.size()) - 1].first][v[int(v.size()) - 1].second] = 1;
  for (i = 1, cnt = 0; i <= x; i++) {
    for (j = 1; j <= y; j++) {
      if (!visit[i][j]) {
        cnt++;
      }
    }
  }
  ans = cnt + ans;
  cout << ans << endl;
}
