#include <bits/stdc++.h>
using namespace std;
int n, m, x00, y00;
int used[600][600];
string s;
int is_valid(int x00, int y00) {
  return 0 <= x00 && x00 < n && 0 <= y00 && y00 < m;
}
int main() {
  cin >> n >> m >> x00 >> y00;
  x00--, y00--;
  cin >> s;
  cout << 1;
  used[x00][y00] = 1;
  for (int(i) = (0); (i) < (int)(s.size()); ++(i)) {
    int nx = x00;
    int ny = y00;
    if (s[i] == 'U') {
      nx--;
    } else if (s[i] == 'R') {
      ny++;
    } else if (s[i] == 'D') {
      nx++;
    } else if (s[i] == 'L') {
      ny--;
    }
    if (is_valid(nx, ny)) {
      x00 = nx;
      y00 = ny;
    }
    int ans = !used[x00][y00];
    if (i + 1 == s.size()) {
      int cnt = 0;
      for (int(i) = (0); (i) < (int)(n); ++(i))
        for (int(j) = (0); (j) < (int)(m); ++(j)) cnt += used[i][j];
      ans = n * m - cnt;
    }
    used[x00][y00] = 1;
    cout << " " << ans;
  }
  return 0;
}
