#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<vector<int> > field;
  int x, y;
  cin >> x >> y;
  field.resize(x);
  for (int i = 0; i < x; ++i) field[i].resize(y);
  for (int i = 0; i < x; ++i)
    for (int j = 0; j < y; ++j) field[i][j] = 0;
  int x0, y0;
  cin >> x0 >> y0;
  x0 -= 1;
  y0 -= 1;
  field[x0][y0] = 1;
  int count = x * y - 1;
  string s;
  cin >> s;
  cout << "1 ";
  for (unsigned int i = 0; i < s.size() - 1; ++i) {
    if (s[i] == 'U' && x0 != 0) {
      x0 -= 1;
      if (field[x0][y0] != 1) {
        field[x0][y0] = 1;
        --count;
        cout << "1 ";
      } else
        cout << "0 ";
    } else if (s[i] == 'D' && x0 != x - 1) {
      x0 += 1;
      if (field[x0][y0] != 1) {
        field[x0][y0] = 1;
        --count;
        cout << "1 ";
      } else
        cout << "0 ";
    } else if (s[i] == 'L' && y0 != 0) {
      y0 -= 1;
      if (field[x0][y0] != 1) {
        field[x0][y0] = 1;
        --count;
        cout << "1 ";
      } else
        cout << "0 ";
    } else if (s[i] == 'R' && y0 != y - 1) {
      y0 += 1;
      if (field[x0][y0] != 1) {
        field[x0][y0] = 1;
        --count;
        cout << "1 ";
      } else
        cout << "0 ";
    } else
      cout << "0 ";
  }
  cout << count;
  return 0;
}
