#include <bits/stdc++.h>
using namespace std;
const int PRIME = 1000 * 1000 * 1000 + 7;
const int MULTIPLIER = 523;
const int INFI = (1 << 30) - 1;
const long double INF = 2 * 1e9 + 1;
const long double EPS = 1e-9;
const long double PI = 3.141592653589793238462643383279502884L;
const int DIM = 2;
const int MAX = 500;
int tab[MAX][MAX];
const int MAX_N = 100 * 1000;
int result[MAX_N + 1];
int main() {
  ios_base::sync_with_stdio(0);
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  --x0;
  --y0;
  string s;
  cin >> s;
  for (int i = 0; i < (x); ++i) {
    for (int j = 0; j < (y); ++j) {
      tab[i][j] = -1;
    }
  }
  tab[x0][y0] = 0;
  result[0] = 1;
  int k = 0;
  for (char c : s) {
    switch (c) {
      case 'L':
        if (y0 > 0) {
          --y0;
        }
        break;
      case 'R':
        if (y0 < y - 1) {
          ++y0;
        }
        break;
      case 'U':
        if (x0 > 0) {
          --x0;
        }
        break;
      case 'D':
        if (x0 < x - 1) {
          ++x0;
        }
        break;
    }
    ++k;
    if (tab[x0][y0] == -1) {
      tab[x0][y0] = k;
      result[k] = 1;
    } else {
      result[k] = 0;
    }
  }
  int overall = x * y;
  for (int i = 0; i <= (int)(s).size(); ++i) {
    overall -= result[i];
  }
  result[(int)(s).size()] += overall;
  for (int i = 0; i < ((int)(s).size() + 1); ++i) {
    cout << result[i] << " ";
  }
  return 0;
}
