#include <bits/stdc++.h>
using namespace std;
int x, y, x01, y01, k, ans = 0;
string s;
int was[501][501];
int main() {
  cin >> x >> y >> x01 >> y01 >> s;
  x01--;
  y01--;
  was[x01][y01] = 1;
  k++;
  cout << 1 << ' ';
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'U' && x01 > 0)
      x01--;
    else if (s[i] == 'D' && x01 + 1 < x)
      x01++;
    else if (s[i] == 'L' && y01 > 0)
      y01--;
    else if (s[i] == 'R' && y01 + 1 < y)
      y01++;
    if (!was[x01][y01]) {
      if (i != s.length() - 1)
        cout << 1 << ' ';
      else
        ans++;
      was[x01][y01] = 1;
      k++;
    } else if (i != s.length() - 1) {
      cout << 0 << ' ';
    }
  }
  cout << ans + x * y - k;
  return 0;
}
