#include <bits/stdc++.h>
volatile bool isLocalTestEnabled = 0;
bool g_isLocalPrintEnabled = (bool)(0);
template <typename T>
void UpdateMin(T& a, const T b) {
  a = std::min(a, b);
}
template <typename T>
void UpdateMax(T& a, const T b) {
  a = std::max(a, b);
}
const long double Pi = std::atan(1.0L) * 4.0L;
static const long double Eps = 1.0e-09;
template <typename T>
bool IsEqual(const T a, const T b) {
  return std::abs(a - b) < Eps;
}
template <typename T>
bool IsGreater(const T a, const T b) {
  return a > b + Eps;
}
template <typename T>
bool IsLess(const T a, const T b) {
  return a + Eps < b;
}
template <typename T>
bool IsGreaterEqual(const T a, const T b) {
  return !IsLess(a, b);
}
template <typename T>
bool IsLessEqual(const T a, const T b) {
  return !IsGreater(a, b);
}
template <typename T>
std::string ToStr(const T& val) {
  std::ostringstream ostr;
  ostr << val;
  return ostr.str();
}
template <typename T>
bool FromStr(const std::string& str, T& val) {
  std::istringstream istr(str);
  istr >> val;
  return !!istr;
}
template <typename T>
std::istream& operator>>(std::istream& ist, std::vector<T>& data) {
  ;
  for (size_t i = 0; i < data.size(); i++) {
    ist >> data[i];
  }
  return ist;
}
template <typename T>
T Read(std::istream& ist) {
  ;
  T val;
  ist >> val;
  return val;
}
template <typename T>
std::ostream& operator<<(std::ostream& ost, const std::vector<T>& data) {
  for (size_t i = 0; i < data.size(); i++) {
    if (i != 0) {
      ost << ' ';
    }
    ost << data[i];
  }
  return ost;
}
template <size_t id>
class StopWatch {};
bool Move(const size_t xs, const size_t ys, const char d, size_t& x,
          size_t& y) {
  size_t nx = x;
  size_t ny = y;
  if (d == 'U') {
    if (nx > 1) nx -= 1;
  } else if (d == 'D') {
    if (nx < xs) nx += 1;
  } else if (d == 'L') {
    if (ny > 1) ny -= 1;
  } else if (d == 'R') {
    if (ny < ys) ny += 1;
  }
  const bool isChanged = ((nx != x) || (ny != y));
  x = nx;
  y = ny;
  return isChanged;
}
bool Solve(std::istream& ist, std::ostream& ost, const bool multipleTestMode) {
  StopWatch<1> sw;
  (void)sw;
  size_t xs, ys, x0, y0;
  ist >> xs >> ys >> x0 >> y0;
  if (multipleTestMode && !ist) return false;
  if (!g_isLocalPrintEnabled) {
  } else
    std::cout << std::endl << "Next test" << std::endl;
  std::string s;
  ist >> s;
  std::vector<std::vector<size_t> > wasHere(xs + 1,
                                            std::vector<size_t>(ys + 1));
  const size_t n = s.size();
  size_t total = xs * ys;
  std::vector<size_t> ans(n + 1);
  ans[0] = 1;
  total -= 1;
  size_t x = x0;
  size_t y = y0;
  wasHere[x][y] = 1;
  for (size_t i = 0; i < n; i++) {
    const bool isMoved = Move(xs, ys, s[i], x, y);
    const bool newCell = !wasHere[x][y];
    if (isMoved && newCell) {
      wasHere[x][y] = 1;
      ans[i + 1] = 1;
      total -= 1;
    }
  }
  ans[n] += total;
  ;
  for (size_t i = 0; i < ans.size(); i++) {
    ;
  }
  ost << ans << std::endl;
  return multipleTestMode;
}
int main(int argc, const char* argv[]) {
  std::ios_base::sync_with_stdio(false);
  std::istream* ist = &std::cin;
  std::ostream* ost = &std::cout;
  std::unique_ptr<std::istream> fileInput;
  if (argc > 1) {
    fileInput.reset(new std::ifstream(argv[1]));
    if (!(*fileInput)) {
      std::cout << "File not found: " << argv[1] << std::endl;
    }
    ist = fileInput.get();
  }
  Solve(*ist, *ost, false);
}
