#include <bits/stdc++.h>
namespace round335d2 {
namespace b {
const int dx[] = {-1, 1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const std::string si = "UDLR";
void upd(int& nz, int z) {
  if (nz > z) nz = z;
  if (nz < 1) nz = 1;
}
int solve(std::istream& in) {
  int x, y, x0, y0;
  while (in >> x) {
    in >> y >> x0 >> y0;
    std::string s;
    in >> s;
    std::map<std::pair<int, int>, int> when;
    when[{x0, y0}] = 0;
    for (size_t i = 0; i < s.size(); ++i) {
      size_t j = si.find(s[i]);
      x0 = x0 + dx[j];
      upd(x0, x);
      y0 = y0 + dy[j];
      upd(y0, y);
      if (when.count({x0, y0})) {
        continue;
      }
      when[{x0, y0}] = i + 1;
    }
    std::vector<int> ans(s.size() + 1, 0);
    for (int x1 = 1; x1 <= x; ++x1) {
      for (int y1 = 1; y1 <= y; ++y1) {
        if (when.count({x1, y1})) {
          size_t j = when[{x1, y1}];
          ans[j] += 1;
        } else {
          ans.back() += 1;
        }
      }
    }
    for (size_t i = 0; i < ans.size(); ++i) {
      std::cout << ans[i] << " ";
    }
    std::cout << "\n";
  }
  return 999;
}
}  // namespace b
}  // namespace round335d2
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  srand((unsigned)time(0));
  int status = 0;
  do {
    status = round335d2::b::solve(std::cin);
  } while (0);
  return 0;
}
