#include <bits/stdc++.h>
using namespace std;
class node {
 public:
  long long int second;
  long long int length;
};
void FastIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  long long int x, y, x1, y1;
  long long int i;
  cin >> x >> y >> x1 >> y1;
  string s;
  cin >> s;
  set<pair<long long int, long long int> > a;
  vector<long long int> ans;
  ans.push_back(1);
  a.insert(make_pair(x1, y1));
  for (i = 0; i < s.length(); i++) {
    if (s[i] == 'U') {
      if (x1 != 1) x1--;
    } else if (s[i] == 'D') {
      if (x1 != x) x1++;
    } else if (s[i] == 'L') {
      if (y1 != 1) y1--;
    } else if (s[i] == 'R') {
      if (y1 != y) y1++;
    }
    if (i != s.length() - 1 && a.find(make_pair(x1, y1)) != a.end())
      ans.push_back(0);
    else {
      if (i == s.length() - 1)
        ans.push_back((x * y) - a.size());
      else
        ans.push_back(1);
    }
    a.insert(make_pair(x1, y1));
  }
  for (i = 0; i < ans.size() - 1; i++) cout << ans[i] << " ";
  cout << ans[i] << endl;
  return 0;
}
