#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
void task();
int main() {
  task();
  return 0;
}
const long long CONST = 1000000;
int n, m;
int x, y;
inline void incx(int &xx) {
  if (xx < n) ++xx;
}
inline void incy(int &yy) {
  if (yy < m) ++yy;
}
inline void decx(int &xx) {
  if (xx > 1) --xx;
}
inline void decy(int &yy) {
  if (yy > 1) --yy;
}
void task() {
  cin >> n >> m;
  cin >> x >> y;
  string str;
  cin >> str;
  set<long long> st;
  long long pre = -1;
  for (int i = (0); i <= (str.size() - 1); ++i) {
    if (st.count(x + (long long)CONST * y) == 0) {
      printf("1 ");
    } else {
      printf("0 ");
    }
    pre = x + (long long)CONST * y;
    st.insert(pre);
    if (str[i] == 'U')
      decx(x);
    else if (str[i] == 'D')
      incx(x);
    else if (str[i] == 'L')
      decy(y);
    else if (str[i] == 'R')
      incy(y);
  }
  cout << (n * (long long)m) - st.size();
}
