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