#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:128000000")
using namespace std;
const int N = 2e5 + 200;
const int INF = int(1e9) + 7;
const long long LINF = 1ll * INF * INF;
const int md = int(1e9) + 7;
const long double eps = 1e-9;
const long double PI = 3.1415926535897932384626433832795l;
int n, m, xs, ys, cnt;
int was[555][555];
int ans[N];
string s;
int main() {
  cin >> n >> m >> xs >> ys;
  cin >> s;
  int len = s.length();
  memset(was, 0, sizeof(was));
  memset(ans, 0, sizeof(ans));
  cnt = 0;
  for (int i = 0; i < len; i++) {
    if (!was[xs][ys]) {
      was[xs][ys] = 1;
      ans[i] = 1;
      cnt++;
    }
    if (s[i] == 'L') {
      if (ys > 1) ys--;
    }
    if (s[i] == 'R') {
      if (ys < m) ys++;
    }
    if (s[i] == 'U') {
      if (xs > 1) xs--;
    }
    if (s[i] == 'D') {
      if (xs < n) xs++;
    }
  }
  ans[len] = n * m - cnt;
  for (int i = 0; i <= len; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
