#include <bits/stdc++.h>
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int x, y, x0, y0;
  std::cin >> x >> y >> x0 >> y0;
  --x0;
  --y0;
  std::string s;
  std::cin >> s;
  std::vector<std::vector<int>> used(x, std::vector<int>(y));
  std::vector<std::vector<int>> first(x, std::vector<int>(y));
  std::vector<int> res;
  res.reserve(s.length() + 1);
  res.push_back(1);
  used[x0][y0] = 1;
  first[x0][y0] = 1;
  int sum = 1;
  int last = 0;
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] == 'L' && y0 > 0) {
      --y0;
    } else if (s[i] == 'R' && y0 + 1 < y) {
      ++y0;
    } else if (s[i] == 'D' && x0 + 1 < x) {
      ++x0;
    } else if (s[i] == 'U' && x0 > 0) {
      --x0;
    }
    if (!used[x0][y0]) {
      res.push_back(1);
      first[x0][y0] = i + 1;
      last = i + 1;
      sum += 1;
    } else {
      res.push_back(0);
    }
    used[x0][y0] = 1;
  }
  res[res.size() - 1] += x * y - sum;
  for (int elem : res) {
    std::cout << elem << " ";
  }
  std::cout << std::endl;
  return 0;
}
