#include <bits/stdc++.h>
using namespace std;
int n, m, i, j;
bool pos(int i, int j) { return i < n && i >= 0 && j < m && j >= 0; }
int main() {
  cin >> n >> m >> i >> j;
  int a[501][501] = {}, used[501][501] = {};
  string s;
  i--, j--;
  used[i][j] = 1;
  cin >> s;
  int cnt = 1;
  cout << 1 << " ";
  for (int p = 0; p < s.size(); p++) {
    if (p == s.size() - 1) {
      if (s[p] == 'U') {
        if (!pos(i - 1, j)) {
          cout << 0 << " ";
          continue;
        }
        cout << n * m - cnt << " ";
      }
      if (s[p] == 'D') {
        if (!pos(i + 1, j)) {
          cout << 0 << " ";
          continue;
        }
        cout << n * m - cnt << " ";
      }
      if (s[p] == 'R') {
        if (!pos(i, j + 1)) {
          cout << 0 << " ";
          continue;
        }
        cout << n * m - cnt << " ";
      }
      if (s[p] == 'L') {
        if (!pos(i, j - 1)) {
          cout << 0 << " ";
          continue;
        }
        cout << n * m - cnt << " ";
      }
      continue;
    }
    if (s[p] == 'U') {
      if (!pos(i - 1, j)) {
        cout << 0 << " ";
        continue;
      }
      i--;
      if (!used[i][j]) {
        cout << 1 << " ";
        used[i][j] = 1;
        cnt++;
      } else {
        cout << 0 << " ";
      }
    }
    if (s[p] == 'D') {
      if (!pos(i + 1, j)) {
        cout << 0 << " ";
        continue;
      }
      i++;
      if (!used[i][j]) {
        cout << 1 << " ";
        used[i][j] = 1;
        cnt++;
      } else {
        cout << 0 << " ";
      }
    }
    if (s[p] == 'R') {
      if (!pos(i, j + 1)) {
        cout << 0 << " ";
        continue;
      }
      j++;
      if (!used[i][j]) {
        cout << 1 << " ";
        used[i][j] = 1;
        cnt++;
      } else {
        cout << 0 << " ";
      }
    }
    if (s[p] == 'L') {
      if (!pos(i, j - 1)) {
        cout << 0 << " ";
        continue;
      }
      j--;
      if (!used[i][j]) {
        cout << 1 << " ";
        used[i][j] = 1;
        cnt++;
      } else {
        cout << 0 << " ";
      }
    }
  }
}
