#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y;
  cin >> x >> y;
  int x0, y0;
  cin >> x0 >> y0;
  string s;
  cin >> s;
  bool moved[501][501] = {{false}};
  int left = x * y;
  cout << "1 ";
  moved[x0][y0] = true;
  left--;
  for (int i = 0; i < s.length() - 1; i++) {
    if (s[i] == 'L' && y0 != 1) y0--;
    if (s[i] == 'R' && y0 != y) y0++;
    if (s[i] == 'U' && x0 != 1) x0--;
    if (s[i] == 'D' && x0 != x) x0++;
    if (!moved[x0][y0]) {
      cout << "1 ";
      moved[x0][y0] = true;
      left--;
    } else
      cout << "0 ";
  }
  cout << left << endl;
  return 0;
}
