#include <bits/stdc++.h>
const long long MOD = (long long)1e9 + 7;
using namespace std;
long long power(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long f = 1LL * power(a, b / 2);
    return 1LL * f * f;
  }
  b--;
  return 1LL * power(a, b) * a;
}
int left(int i) { return 2 * i; }
int right(int i) { return 2 * i + 1; }
map<pair<int, pair<int, int>>, bool> vis;
int a, b, c, x, y, z;
int result[1000000];
int main() {
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  int xc = x0, yc = y0;
  string s;
  cin >> s;
  map<pair<int, int>, bool> vis;
  int houseVisited = 0;
  for (int i = 0; i < s.length(); i++) {
    if (!vis[make_pair(xc, yc)]) {
      result[i] = 1;
      houseVisited++;
    }
    vis[make_pair(xc, yc)] = 1;
    if (s[i] == 'U' && xc - 1 >= 1) {
      xc--;
    }
    if (s[i] == 'D' && xc + 1 <= x) {
      xc++;
    }
    if (s[i] == 'R' && yc + 1 <= y) {
      yc++;
    }
    if (s[i] == 'L' && yc - 1 >= 1) {
      yc--;
    }
  }
  result[(int)s.length()] = x * y - houseVisited;
  for (int i = 0; i <= s.length(); i++) {
    cout << result[i] << " ";
  }
}
