#include <bits/stdc++.h>
using namespace std;
int arr[505][505];
int mark[100005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string s;
  cin >> s;
  mark[0] = 1;
  arr[x0][y0] = 1;
  if (s[0] == 'L' && y0 > 1) {
    y0--;
  }
  if (s[0] == 'R' && y0 < y) {
    y0++;
  }
  if (s[0] == 'U' && x0 > 1) {
    x0--;
  }
  if (s[0] == 'D' && x0 < x) {
    x0++;
  }
  cout << mark[0] << " ";
  for (int i = 1; i < s.size(); i++) {
    if (arr[x0][y0] == 1) {
      mark[i] = 0;
    } else {
      arr[x0][y0] = 1;
      mark[i] = 1;
    }
    if (s[i] == 'L' && y0 > 1) {
      y0--;
    }
    if (s[i] == 'R' && y0 < y) {
      y0++;
    }
    if (s[i] == 'U' && x0 > 1) {
      x0--;
    }
    if (s[i] == 'D' && x0 < x) {
      x0++;
    }
    cout << mark[i] << " ";
  }
  int count = 0;
  for (int i = 1; i <= x; i++)
    for (int j = 1; j <= y; j++)
      if (arr[i][j] == 1) count++;
  cout << x * y - count << '\n';
  return 0;
}
