#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, x0, y0;
  cin >> x;
  cin >> y;
  cin >> x0;
  cin >> y0;
  string directions;
  string output = "1";
  cin >> directions;
  bool used[505][505] = {false};
  int counter = 1;
  used[x0][y0] = true;
  for (int i = 0; i < directions.length() - 1; i++) {
    switch (directions[i]) {
      case 'L':
        if (y0 > 1) {
          y0--;
        }
        break;
      case 'R':
        if (y0 < y) {
          y0++;
        }
        break;
      case 'U':
        if (x0 > 1) {
          x0--;
        }
        break;
      case 'D':
        if (x0 < x) {
          x0++;
        }
        break;
    }
    if (!used[x0][y0]) {
      counter++;
      used[x0][y0] = true;
      output.append(" 1");
    } else {
      output.append(" 0");
    }
  }
  ostringstream convert;
  int q = x * y - counter;
  convert << q;
  output.append(" " + convert.str());
  cout << output << endl;
  cin >> x;
}
