#include <bits/stdc++.h>
using namespace std;
int main() {
  int fd[507][507], n, m, x, y, c = 0;
  string s;
  cin >> n >> m >> x >> y >> s;
  cout << "1"
       << " ";
  int l = s.length();
  for (int i = 0; i < l - 1; i++) {
    fd[x][y] = 1;
    if (s[i] == 'U' && x > 1) x--;
    if (s[i] == 'D' && x < n) x++;
    if (s[i] == 'L' && y > 1) y--;
    if (s[i] == 'R' && y < m) y++;
    if (fd[x][y] == 1)
      cout << "0"
           << " ";
    else {
      cout << "1"
           << " ";
      c++;
    }
  }
  cout << n * m - c - 1;
}
