#include <bits/stdc++.h>
using namespace std;
int mx[4] = {-1, 1, 0, 0};
int my[4] = {0, 0, -1, 1};
vector<pair<int, int> > seq;
vector<int> times;
int a, b;
int ans[100005];
int vis[502][502];
int conv(char c) {
  if (c == 'U')
    return 0;
  else if (c == 'D')
    return 1;
  else if (c == 'L')
    return 2;
  else if (c == 'R')
    return 3;
}
bool check(pair<int, int> p, int k) {
  if (p.first + mx[k] >= 1 && p.first + mx[k] <= a && p.second + my[k] >= 1 &&
      p.second + my[k] <= b)
    return true;
  return false;
}
int main() {
  int c, d;
  cin >> a >> b >> c >> d;
  string s;
  cin >> s;
  seq.push_back(pair<int, int>(c, d));
  pair<int, int> cur(c, d);
  times.push_back(1);
  for (int i = 0; i < s.size(); ++i) {
    int k = conv(s[i]);
    if (check(cur, k)) {
      cur = pair<int, int>(cur.first + mx[k], cur.second + my[k]);
      seq.push_back(cur);
      times.push_back(1);
    } else {
      times[times.size() - 1]++;
    }
  }
  int ind = 0;
  for (int i = 0; i < seq.size(); ++i) {
    pair<int, int> p = seq[i];
    if (vis[p.first][p.second] == 0) {
      ans[ind] += 1;
      vis[p.first][p.second] = 1;
    }
    ind += times[i];
  }
  int unvis = 0;
  for (int i = 1; i <= a; ++i) {
    for (int j = 1; j <= b; ++j)
      if (vis[i][j] == 0) ++unvis;
  }
  ans[s.size()] += unvis;
  for (int i = 0; i <= s.size(); ++i) cout << ans[i] << ' ';
}
