#include <bits/stdc++.h>
const long long gig = 1e18;
const long long gg = 25 * 1e6;
const long long mod = 1e9 + 7;
using namespace std;
long long ot[111111];
long long f[555][555];
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, m, x, y;
  cin >> n >> m >> x >> y;
  cin >> s;
  long long o = 1;
  ot[0] = 1;
  f[x][y] = 1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'L') y--;
    if (s[i] == 'R') y++;
    if (s[i] == 'U') x--;
    if (s[i] == 'D') x++;
    x = max(1LL, x);
    y = max(1LL, y);
    x = min(n, x);
    y = min(m, y);
    if (f[x][y] == 0) {
      ot[i + 1]++;
      f[x][y] = 1;
      o++;
    }
  }
  ot[s.size()] += n * m - o;
  for (int i = 0; i <= s.size(); i++) cout << ot[i] << " ";
}
