#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) { cerr << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\t";
  err(++it, args...);
}
template <typename T1, typename T2>
ostream& operator<<(ostream& c, pair<T1, T2>& v) {
  c << "(" << v.first << "," << v.second << ")";
  return c;
}
template <template <class...> class TT, class... T>
ostream& operator<<(ostream& out, TT<T...>& c) {
  out << "{ ";
  for (auto& x : c) out << x << " ";
  out << "}";
  return out;
}
const long long N = 4e5 + 5, MOD = 1e9 + 7;
bool vis[505][505];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long x, y, sx, sy;
  cin >> x >> y >> sx >> sy;
  string s;
  cin >> s;
  long long ans = x * y;
  for (long long i = 0; i < s.size(); i++) {
    if (!vis[sx][sy])
      cout << "1 ", ans--;
    else
      cout << "0 ";
    vis[sx][sy] = 1;
    if (s[i] == 'U' && sx > 1) sx--;
    if (s[i] == 'D' && sx < x) sx++;
    if (s[i] == 'L' && sy > 1) sy--;
    if (s[i] == 'R' && sy < y) sy++;
  }
  cout << ans << " ";
}
