#include <bits/stdc++.h>
using namespace std;
int vis[505][505];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL), cout.precision(15);
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < s.length(); i++) {
    if (vis[x0][y0])
      cout << "0 ";
    else {
      cout << "1 ";
      cnt++;
      vis[x0][y0] = 1;
    }
    if (s[i] == 'L') {
      y0 = max(1, y0 - 1);
    } else if (s[i] == 'R') {
      y0 = min(y, y0 + 1);
    } else if (s[i] == 'U') {
      x0 = max(1, x0 - 1);
    } else if (s[i] == 'D') {
      x0 = min(x, x0 + 1);
    }
  }
  cout << x * y - cnt << "\n";
  return 0;
}
