#include <bits/stdc++.h>
using namespace std;
long long max(long long a, int b) {
  if (a > b) return a;
  return b;
}
int main() {
  int x, y, a, b;
  string s;
  cin >> x >> y >> a >> b >> s;
  int kl = s.length();
  int count = 1;
  bool ans[x + 1][y + 1];
  for (int i = 1; i <= x; i++)
    for (int j = 1; j <= y; j++) ans[i][j] = false;
  cout << "1"
       << " ";
  ans[a][b] = 1;
  for (int i = 0; i < kl - 1; i++) {
    if (s[i] == 'D') {
      if (a + 1 <= x) {
        a++;
        if (!ans[a][b] && count < x * y) {
          count++;
          cout << "1 ";
          ans[a][b] = 1;
        } else
          cout << "0 ";
      } else
        cout << "0 ";
    }
    if (s[i] == 'U') {
      if (a - 1 >= 1) {
        a--;
        if (!ans[a][b] && count < x * y) {
          count++;
          cout << "1 ";
          ans[a][b] = 1;
        } else
          cout << "0 ";
      } else
        cout << "0 ";
    }
    if (s[i] == 'L') {
      if (b - 1 >= 1) {
        b--;
        ;
        if (!ans[a][b] && count < x * y) {
          count++;
          cout << "1 ";
          ans[a][b] = 1;
        } else
          cout << "0 ";
      } else
        cout << "0 ";
    }
    if (s[i] == 'R') {
      if (b + 1 <= y) {
        b++;
        if (!ans[a][b] && count < x * y) {
          count++;
          cout << "1 ";
          ans[a][b] = 1;
        } else
          cout << "0 ";
      } else
        cout << "0 ";
    }
  }
  if (count < x * y)
    cout << x * y - count;
  else
    cout << "0 ";
}
