#include <bits/stdc++.h>
using namespace std;
pair<int, int> getnew(int xb, int yb, int xs, int ys, char command) {
  if (command == 'U' && xs >= 1) {
    return {xs - 1, ys};
  } else if (command == 'R' && ys < yb - 1) {
    return {xs, ys + 1};
  } else if (command == 'D' && xs < xb - 1) {
    return {xs + 1, ys};
  } else if (command == 'L' && ys >= 1) {
    return {xs, ys - 1};
  }
  return {xs, ys};
}
int main() {
  int xb, yb, xs, ys;
  cin >> xb >> yb >> xs >> ys;
  xs--;
  ys--;
  string s;
  cin >> s;
  vector<vector<bool>> seen(xb, vector<bool>(yb, false));
  int visited = 1;
  vector<int> ans(s.size() + 1);
  ans[0] = 1;
  seen[xs][ys] = true;
  for (int i = 0; i < s.size(); i++) {
    tie(xs, ys) = getnew(xb, yb, xs, ys, s[i]);
    if (!seen[xs][ys]) {
      visited++;
      seen[xs][ys] = true;
      ans[i + 1] = 1;
    } else {
      ans[i + 1] = 0;
    }
  }
  ans[s.size()] += xb * yb - visited;
  for (auto a : ans) cout << a << " ";
  cout << endl;
}
