#include <bits/stdc++.h>
using namespace std;
const int A = 505;
bool vis[A][A];
vector<int> start(int m, int n, int a, int b, string &s) {
  int x = a;
  int y = b;
  int cont = 0;
  vector<int> ans;
  for (int i = 0; i < s.size(); i++) {
    if (!vis[x][y]) {
      ans.push_back(1);
      vis[x][y] = true;
      cont++;
    } else {
      ans.push_back(0);
    }
    if (s[i] == 'U')
      if (x > 1) x--;
    if (s[i] == 'D')
      if (x < m) x++;
    if (s[i] == 'L')
      if (y > 1) y--;
    if (s[i] == 'R')
      if (y < n) y++;
  }
  ans.push_back(m * n - cont);
  return ans;
}
int main() {
  int n, m, x, y;
  string s;
  cin >> m >> n >> x >> y;
  cin >> s;
  vector<int> ans = start(m, n, x, y, s);
  for (auto it : ans) cout << it << " ";
  cout << "\n";
}
