#include <bits/stdc++.h>
using namespace std;
int n, m, k, ans, x, y;
bool used[555][555];
int main() {
  cin >> n >> m >> x >> y;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); ++i) {
    if (!used[x][y]) {
      k++;
      cout << 1 << ' ';
    } else
      cout << 0 << ' ';
    used[x][y] = true;
    if (s[i] == 'U')
      x--;
    else if (s[i] == 'D')
      x++;
    else if (s[i] == 'R')
      y++;
    else
      y--;
    if (x == 0) x++;
    if (y == 0) y++;
    if (x > n) x--;
    if (y > m) y--;
  }
  cout << n * m - k;
}
