#include <bits/stdc++.h>
using namespace std;
const double PI = acos(0) * 2;
const double EPS = 1e-8;
const long long MOD = 1e9 + 7;
const int MAXN = 1e5 + 5;
const int oo = 1e9;
const double foo = 1e30;
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcounll(s);
}
int cnt, vs[505][505], n, m, a[100100];
string s;
void loang(int x, int y, int pos) {
  if (pos >= ((int)(s).size())) return;
  if (vs[x][y])
    a[pos] = 0;
  else {
    vs[x][y] = 1;
    if (pos != -1) a[pos] = 1;
    cnt++;
  }
  pos++;
  if (s[pos] == 'U') {
    x = max(1, x - 1);
    loang(x, y, pos);
    return;
  }
  if (s[pos] == 'L') {
    y = max(1, y - 1);
    loang(x, y, pos);
    return;
  }
  if (s[pos] == 'R') {
    y = min(m, y + 1);
    loang(x, y, pos);
    return;
  }
  if (s[pos] = 'D') {
    x = min(n, x + 1);
    loang(x, y, pos);
    return;
  }
}
int main() {
  int x0, y0;
  cin >> n >> m >> x0 >> y0;
  cin >> s;
  loang(x0, y0, -1);
  int n1 = ((int)(s).size()) - 1;
  a[n1] = a[n1] + n * m - cnt;
  cout << 1 << " ";
  for (int i = 0; i < ((int)(s).size()); i++) {
    cout << a[i] << " ";
  }
}
