#include <bits/stdc++.h>
using namespace std;
int a[505][505];
int main() {
  vector<pair<int, int> > vec;
  int x, y, x0, y0;
  scanf("%d %d %d %d", &x, &y, &x0, &y0);
  for (int i = 0; i <= x; i++) {
    for (int j = 0; j <= y; j++) a[i][j] = -1;
  }
  string s;
  cin >> s;
  vec.push_back(make_pair(x0, y0));
  a[x0][y0] = 0;
  int non_uni = 0;
  for (int i = 0; i < s.size(); i++) {
    int j = i + 1;
    if (s[i] == 'L') {
      if (vec[j - 1].second > 1) {
        vec.push_back(make_pair(vec[j - 1].first, vec[j - 1].second - 1));
        if (a[vec[j - 1].first][vec[j - 1].second - 1] == -1)
          a[vec[j - 1].first][vec[j - 1].second - 1] = j;
        else
          non_uni++;
      } else {
        vec.push_back(make_pair(vec[j - 1].first, vec[j - 1].second));
        non_uni++;
      }
    } else if (s[i] == 'R') {
      if (vec[j - 1].second < y) {
        vec.push_back(make_pair(vec[j - 1].first, vec[j - 1].second + 1));
        if (a[vec[j - 1].first][vec[j - 1].second + 1] == -1)
          a[vec[j - 1].first][vec[j - 1].second + 1] = j;
        else
          non_uni++;
      } else {
        vec.push_back(make_pair(vec[j - 1].first, vec[j - 1].second));
        non_uni++;
      }
    } else if (s[i] == 'U') {
      if (vec[j - 1].first > 1) {
        vec.push_back(make_pair(vec[j - 1].first - 1, vec[j - 1].second));
        if (a[vec[j - 1].first - 1][vec[j - 1].second] == -1)
          a[vec[j - 1].first - 1][vec[j - 1].second] = j;
        else
          non_uni++;
      } else {
        vec.push_back(make_pair(vec[j - 1].first, vec[j - 1].second));
        non_uni++;
      }
    } else if (s[i] == 'D') {
      if (vec[j - 1].first < x) {
        vec.push_back(make_pair(vec[j - 1].first + 1, vec[j - 1].second));
        if (a[vec[j - 1].first + 1][vec[j - 1].second] == -1)
          a[vec[j - 1].first + 1][vec[j - 1].second] = j;
        else
          non_uni++;
      } else {
        vec.push_back(make_pair(vec[j - 1].first, vec[j - 1].second));
        non_uni++;
      }
    }
  }
  int ans;
  for (int i = 0; i < s.size() + 1; i++) {
    if (i == s.size()) {
      if (a[vec[i].first][vec[i].second] != i)
        ans = (x * y) - (s.size() + 1) + non_uni;
      else
        ans = (x * y) - (s.size() + 1) + non_uni + 1;
    } else if (i != 0) {
      if (a[vec[i].first][vec[i].second] != i)
        ans = 0;
      else
        ans = 1;
    } else if (i == 0)
      ans = 1;
    printf("%d ", ans);
  }
  printf("\n");
  return 0;
}
