#include <bits/stdc++.h>
using namespace std;
void run() {
  int x, y, x0, y0;
  string s;
  cin >> x >> y >> x0 >> y0;
  cin >> s;
  x0--;
  y0--;
  vector<vector<int> > vis(y);
  for (int i = 0; i < y; i++) vis[i] = vector<int>(x, 0);
  int sum = 0;
  for (int i = 0; i < s.size(); i++) {
    int r = 0;
    if (!vis[y0][x0]) r = 1;
    vis[y0][x0] = 1;
    sum += r;
    if (i > 0) printf(" ");
    printf("%d", r);
    if (i < s.size()) {
      if (s[i] == 'U' && x0 > 0) x0--;
      if (s[i] == 'D' && x0 < x - 1) x0++;
      if (s[i] == 'L' && y0 > 0) y0--;
      if (s[i] == 'R' && y0 < y - 1) y0++;
    }
  }
  printf(" %d\n", x * y - sum);
}
int main() {
  cout << fixed << setprecision(16);
  run();
  return 0;
}
