#include <bits/stdc++.h>
using namespace std;
template <class T>
T &get(T &n) {
  cin >> n;
  return n;
}
const long long hell = 1000000007;
const long long INF = (long long)hell * hell;
const int MAXN = 5e2 + 1;
const int MAXH = 1e3 + 1;
const int BLOCK = 100;
const int MAXQ = 10001;
int A[MAXN][MAXN];
int findSum(int X, int Y) {
  int i, j, res = 0;
  for (i = 1; i < X + 1; i++)
    for (j = 1; j < Y + 1; j++)
      if (A[i][j]) res++;
  return res;
}
void construct_matrix(int X, int Y, int X0, int Y0, string s) {
  int i, l = s.length();
  int currX = X0, currY = Y0;
  cout << "1 ";
  A[currX][currY] = 1;
  for (i = 0; i < l; i++) {
    if (s[i] == 'U') {
      if (currX > 1) --currX;
    } else if (s[i] == 'D') {
      if (currX < X) ++currX;
    } else if (s[i] == 'R') {
      if (currY < Y) ++currY;
    } else {
      if (currY > 1) --currY;
    }
    if (i == l - 1) {
      int res = X * Y - findSum(X, Y);
      cout << res;
    } else {
      if (A[currX][currY] == 0)
        A[currX][currY] = 1, cout << "1 ";
      else
        cout << "0 ";
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int N, M, X0, Y0;
  cin >> N >> M >> X0 >> Y0;
  string s;
  cin >> s;
  construct_matrix(N, M, X0, Y0, s);
}
