#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string s;
  cin >> s;
  vector<vector<bool> > tracker(x, vector<bool>(y, false));
  int curx = x0;
  int cury = y0;
  tracker[curx - 1][cury - 1] = true;
  vector<int> answers(s.size());
  int visited = 1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'L' && cury != 1)
      cury -= 1;
    else if (s[i] == 'R' && cury != y)
      cury += 1;
    else if (s[i] == 'U' && curx != 1)
      curx -= 1;
    else if (s[i] == 'D' && curx != x)
      curx += 1;
    if (tracker[curx - 1][cury - 1]) {
      answers[i] = 0;
    } else {
      tracker[curx - 1][cury - 1] = true;
      answers[i] = 1;
      visited += 1;
    }
  }
  answers[answers.size() - 1] += (x * y) - visited;
  vector<int> ansrefined(answers.size() + 1);
  ansrefined[0] = 1;
  int n = answers.size();
  for (int i = 0; i < n; i++) {
    ansrefined[i + 1] = answers[i];
  }
  for (int i = 0; i < n + 1; i++) {
    cout << ansrefined[i] << " ";
  }
  cout << endl;
  return 0;
}
