#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, c, x, y;
  string s;
  cin >> r >> c >> x >> y;
  cin >> s;
  vector<int> visited(r * c + 1, 0);
  cout << "1 ";
  int t, n = s.size();
  visited[c * (x - 1) + y] = 1;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == 'U' && (x - 1 >= 1 && x - 1 <= r)) {
      x -= 1;
      t = c * (x - 1) + y;
      if (visited[t])
        cout << "0 ";
      else {
        visited[t] = 1;
        cout << "1 ";
      }
    } else if (s[i] == 'U')
      cout << "0 ";
    else if (s[i] == 'D' && (x + 1 >= 1 && x + 1 <= r)) {
      x += 1;
      t = c * (x - 1) + y;
      if (visited[t])
        cout << "0 ";
      else {
        visited[t] = 1;
        cout << "1 ";
      }
    } else if (s[i] == 'D')
      cout << "0 ";
    else if (s[i] == 'L' && (y - 1 >= 1 && y - 1 <= c)) {
      y -= 1;
      t = c * (x - 1) + y;
      if (visited[t])
        cout << "0 ";
      else {
        visited[t] = 1;
        cout << "1 ";
      }
    } else if (s[i] == 'L')
      cout << "0 ";
    else if (s[i] == 'R' && (y + 1 >= 1 && y + 1 <= c)) {
      y += 1;
      t = c * (x - 1) + y;
      if (visited[t])
        cout << "0 ";
      else {
        visited[t] = 1;
        cout << "1 ";
      }
    } else
      cout << "0 ";
  }
  t = 0;
  for (int i = 1; i <= r * c; i++) {
    if (visited[i] == 1) t++;
  }
  cout << r * c - t;
  return 0;
}
