#include <bits/stdc++.h>
using namespace std;
const long long int N = 200005;
bool bm[501][501];
int main() {
  ios::sync_with_stdio(false);
  long long int a, b, x, y;
  string s;
  cin >> a >> b >> x >> y >> s;
  for (long long int i = 0; i < s.length(); i++) {
    if (bm[x][y]) {
      cout << "0 ";
    } else {
      cout << "1 ";
    }
    bm[x][y] = true;
    if (s[i] == 'U') {
      if ((x - 1) >= 1) {
        x--;
      }
    }
    if (s[i] == 'D') {
      if ((x + 1) <= a) {
        x++;
      }
    }
    if (s[i] == 'L') {
      if ((y - 1) >= 1) {
        y--;
      }
    }
    if (s[i] == 'R') {
      if ((y + 1) <= b) {
        y++;
      }
    }
  }
  long long int cnt = 0;
  for (long long int i = 1; i < a + 1; i++) {
    for (long long int j = 1; j < b + 1; j++) {
      if (!bm[i][j]) {
        cnt++;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
