#include <bits/stdc++.h>
using namespace std;
inline long long pw(long long a, long long b) {
  return (b) ? (pw((a) * (a), (b) >> 1) * ((b)&1 ? (a) : 1)) : 1;
}
const int MAXN = 1e6 + 5;
const long long INF = 1e10;
const int MOD = 1e9 + 7;
long long dp[MAXN];
int x, y, u, r;
map<pair<int, int>, bool> mp;
void pos(char ch, int r, int u) {}
int main() {
  int cur = 1;
  cin >> x >> y >> r >> u;
  r--;
  u--;
  string s;
  cin >> s;
  dp[0] = 1;
  mp[make_pair(r, u)] = true;
  for (int i = 0; i < s.size(); i++) {
    char ch = s[i];
    if (ch == 'L' && u > 0)
      u--;
    else if (ch == 'R' && u < y - 1)
      u++;
    else if (ch == 'U' && r > 0)
      r--;
    else if (ch == 'D' && r < x - 1)
      r++;
    if (i != s.size() - 1) {
      if (!mp[make_pair(r, u)])
        dp[i + 1] = 1;
      else
        dp[i + 1] = 0;
    }
    if (i == s.size() - 1) {
      dp[i + 1] = x * y - cur;
    }
    if (!mp[make_pair(r, u)]) {
      cur++;
      mp[make_pair(r, u)] = true;
    }
  }
  for (int i = 0; i < s.size() + 1; i++) cout << dp[i] << " ";
}
