#include <bits/stdc++.h>
using namespace std;
int x, y, x0, y2;
bool a[505][505] = {0};
int main() {
  cin >> x >> y >> x0 >> y2;
  string s;
  cin >> s;
  int re = x * y;
  for (int i = 0; i < s.size(); ++i) {
    printf("%d ", 1 - a[x0][y2]);
    if (a[x0][y2] == 0) --re;
    a[x0][y2] = 1;
    if (s[i] == 'U')
      --x0;
    else if (s[i] == 'D')
      ++x0;
    else if (s[i] == 'L')
      --y2;
    else
      ++y2;
    if (x0 == 0) x0 = 1;
    if (x0 == x + 1) x0 = x;
    if (y2 == 0) y2 = 1;
    if (y2 == y + 1) y2 = y;
  }
  cout << re;
}
