#include <bits/stdc++.h>
using namespace std;
int mark[550][550];
int main() {
  int n, m, Xi, Yi;
  string s;
  cin >> n >> m >> Xi >> Yi >> s;
  int t = n * m;
  for (int i = 0; i < (int)s.size(); i++) {
    cout << !mark[Xi][Yi] << ' ';
    if (!mark[Xi][Yi]) t--;
    mark[Xi][Yi] = 1;
    if (s[i] == 'U') Xi--;
    if (s[i] == 'D') Xi++;
    if (s[i] == 'L') Yi--;
    if (s[i] == 'R') Yi++;
    Yi = min(Yi, m), Xi = min(Xi, n);
    Yi = max(Yi, 1), Xi = max(Xi, 1);
  }
  cout << t;
  return 0;
}
