#include <bits/stdc++.h>
using namespace std;
const int N = 510;
const int M = 100010;
int n, m, k, xs, ys, ans[M];
string s;
bool used[N][N];
int main() {
  cin >> n >> m >> xs >> ys;
  cin >> s;
  k = s.length();
  memset(used, false, sizeof(used));
  used[xs][ys] = true;
  ans[0]++;
  int c = 1;
  for (int i = 0; i < k; i++) {
    if (s[i] == 'L')
      ys = max(ys - 1, 1);
    else if (s[i] == 'R')
      ys = min(ys + 1, m);
    else if (s[i] == 'U')
      xs = max(xs - 1, 1);
    else
      xs = min(xs + 1, n);
    if (!used[xs][ys]) {
      ans[i + 1]++;
      c++;
      used[xs][ys] = true;
    }
  }
  ans[k] += n * m - c;
  for (int i = 0; i <= k; i++) cout << ans[i] << " ";
  return 0;
}
