#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int x = 0, y = 0, x0 = 0, y0 = 0;
  string s = "";
  cin >> x >> y >> x0 >> y0 >> s;
  int noOfTests = x * y;
  noOfTests--;
  int grid[x][y];
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < y; j++) {
      grid[i][j] = 0;
    }
  }
  cout << "1 ";
  grid[x0 - 1][y0 - 1]++;
  for (int i = 0; i < s.length() - 1; i++) {
    switch (s[i]) {
      case 'U': {
        if (x0 > 1) {
          x0--;
          if (grid[x0 - 1][y0 - 1] > 0)
            cout << "0";
          else {
            cout << "1";
            grid[x0 - 1][y0 - 1]++;
            noOfTests--;
          }
        } else
          cout << "0";
        break;
      }
      case 'D': {
        if (x0 < x) {
          x0++;
          if (grid[x0 - 1][y0 - 1] > 0)
            cout << "0";
          else {
            cout << "1";
            grid[x0 - 1][y0 - 1]++;
            noOfTests--;
          }
        } else
          cout << "0";
        break;
      }
      case 'L': {
        if (y0 > 1) {
          y0--;
          if (grid[x0 - 1][y0 - 1] > 0)
            cout << "0";
          else {
            cout << "1";
            grid[x0 - 1][y0 - 1]++;
            noOfTests--;
          }
        } else
          cout << "0";
        break;
      }
      case 'R': {
        if (y0 < y) {
          y0++;
          if (grid[x0 - 1][y0 - 1] > 0)
            cout << "0";
          else {
            cout << "1";
            grid[x0 - 1][y0 - 1]++;
            noOfTests--;
          }
        } else
          cout << "0";
        break;
      }
    }
    cout << " ";
  }
  cout << noOfTests;
  return 0;
}
