#include <bits/stdc++.h>
using namespace std;
bool arr[505][505];
char ch[1000000];
int main() {
  int i, j, x, y, temp, x0, y0, a, b;
  cin >> x >> y >> x0 >> y0;
  cin >> ch;
  int k = strlen(ch);
  a = x0;
  int count = 1;
  b = y0;
  arr[x0][y0] = true;
  cout << "1";
  for (i = 0; i < k - 1; i++) {
    if (ch[i] == 'U') {
      if (a > 1) {
        a--;
        if (!arr[a][b]) {
          count++;
          cout << " 1";
        } else
          cout << " 0";
      } else
        cout << " 0";
    } else if (ch[i] == 'D') {
      if (a < x) {
        a++;
        if (!arr[a][b]) {
          count++;
          cout << " 1";
        } else
          cout << " 0";
      } else
        cout << " 0";
    } else if (ch[i] == 'L') {
      if (b > 1) {
        b--;
        if (!arr[a][b]) {
          count++;
          cout << " 1";
        } else
          cout << " 0";
      } else
        cout << " 0";
    } else if (ch[i] == 'R') {
      if (b < y) {
        b++;
        if (!arr[a][b]) {
          count++;
          cout << " 1";
        } else
          cout << " 0";
      } else
        cout << " 0";
    }
    arr[a][b] = true;
  }
  count = x * y - count;
  cout << " " << count;
  return 0;
}
