#include <bits/stdc++.h>
using namespace std;
long long int powe(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % 1000000007;
    b = b / 2;
    a = (a * a) % 1000000007;
  }
  return ans;
}
long long int gcde(long long int a, long long int b) {
  if (b == 0) return a;
  return gcde(b, a % b);
}
int mark[609][609];
int main() {
  int n, ct = 0, i, x, y, x0, y0, k, j;
  string s;
  cin >> x >> y >> x0 >> y0;
  cin >> s;
  i = x0;
  j = y0;
  k = 0;
  mark[i][j] = 1;
  cout << 1 << " ";
  int prev_x, prev_y;
  int ans = 1;
  while (s[k] != '\0') {
    prev_x = i;
    prev_y = j;
    if (s[k] == 'U' and i > 1)
      i--;
    else if (s[k] == 'D' and i < x)
      i++;
    else if (s[k] == 'L' and j > 1)
      j--;
    else if (j < y and s[k] == 'R')
      j++;
    if (prev_x == i and prev_y == j and s[k + 1] != '\0')
      cout << 0 << " ";
    else if (s[k + 1] == '\0' or prev_x != i or prev_y != j) {
      if (s[k + 1] == '\0') {
        cout << x * y - ans;
      } else if (!mark[i][j]) {
        cout << 1 << " ";
        ans++;
      } else {
        cout << 0 << " ";
      }
    }
    mark[i][j] = 1;
    k++;
  }
  return 0;
}
