#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e3 + 10;
bool used[MAX_N][MAX_N];
const int BUFSIZE = 1000000;
char buf[BUFSIZE + 1];
string nextString() {
  scanf("%s", buf);
  return buf;
}
int main() {
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  const string s = nextString();
  const size_t n = s.size();
  int count = 0;
  for (int i = 0; i < (n); ++i) {
    if (!used[x0][y0]) {
      cout << "1 ";
      count++;
    } else {
      cout << "0 ";
    }
    used[x0][y0] = true;
    switch (s[i]) {
      case 'L':
        y0 -= 1;
        break;
      case 'R':
        y0 += 1;
        break;
      case 'U':
        x0 -= 1;
        break;
      case 'D':
        x0 += 1;
        break;
    }
    y0 = min(max(1, y0), y);
    x0 = min(max(1, x0), x);
  }
  cout << x * y - count << endl;
  return 0;
}
