#include <bits/stdc++.h>
using namespace std;
const int MX_SZ = 542;
inline pair<int, int> get_mod(char c) {
  if (c == 'U') {
    return {-1, 0};
  } else if (c == 'D') {
    return {1, 0};
  } else if (c == 'R') {
    return {0, 1};
  } else {
    return {0, -1};
  }
}
int main() {
  int x, y, sx, sy;
  pair<int, int> pos;
  cin >> x >> y >> pos.first >> pos.second;
  string s;
  cin >> s;
  bool used[MX_SZ][MX_SZ];
  int cnt = 1;
  cout << 1 << " ";
  used[pos.first][pos.second] = true;
  for (int i = 0; i < (int)s.size(); i++) {
    pos.first += get_mod(s[i]).first;
    pos.second += get_mod(s[i]).second;
    if (i == (int)s.size() - 1) {
      cout << x * y - cnt << " ";
      return 0;
    }
    if (pos.first >= 1 and pos.second >= 1 and pos.first <= x and
        pos.second <= y) {
      if (used[pos.first][pos.second]) {
        cout << 0 << " ";
      } else {
        cout << 1 << " ";
        used[pos.first][pos.second] = true;
        cnt++;
      }
    } else {
      pos.first -= get_mod(s[i]).first;
      pos.second -= get_mod(s[i]).second;
      cout << 0 << " ";
    }
  }
}
