#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  string a;
  cin >> a;
  int g = 0;
  int l = a.size();
  vector<vector<int> > tabl(x, vector<int>(y, 0));
  int i = x0 - 1, j = y0 - 1;
  tabl[i][j] = 1;
  for (int k = 0; k < l; k++) {
    if (a[k] == 'R') {
      if (j < (y - 1)) {
        j++;
        tabl[i][j] == 0 ? tabl[i][j] = k + 2 : g = 0;
      }
    } else if (a[k] == 'L') {
      if (j > 0) {
        j--;
        tabl[i][j] == 0 ? tabl[i][j] = k + 2 : g = 0;
      }
    } else if (a[k] == 'D') {
      if (i < (x - 1)) {
        i++;
        tabl[i][j] == 0 ? tabl[i][j] = k + 2 : g = 0;
      }
    } else if (a[k] == 'U') {
      if (i > 0) {
        i--;
        tabl[i][j] == 0 ? tabl[i][j] = k + 2 : g = 0;
      }
    }
  }
  vector<int> ans(l + 1, 0);
  int o = 0;
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < y; j++) {
      if (tabl[i][j] != 0) {
        ans[tabl[i][j] - 1]++;
      } else
        o++;
    }
  }
  for (int i = l; i > 0; i--) {
    if (i != 0) {
      ans[i] += o;
      break;
    }
  }
  for (int i = 0; i < (l + 1); i++) {
    cout << ans[i] << ' ';
  }
  return 0;
}
