#include <bits/stdc++.h>
using namespace std;
struct location {
  int x, y;
};
const int maxn = 1e5 + 8;
const int maxm = 508;
location l[maxn];
int x, y;
bool m[maxm][maxm];
int main(int argc, const char* argv[]) {
  string s;
  int x0, y0;
  cin >> x >> y >> x0 >> y0;
  cin >> s;
  l[0].x = x0;
  l[0].y = y0;
  for (int i = 1; i <= x; i++) {
    for (int j = 1; j <= y; j++) {
      m[i][j] = false;
    }
  }
  for (int i = 0; i < s.length(); i++) {
    l[i + 1].x = l[i].x;
    l[i + 1].y = l[i].y;
    switch (s[i]) {
      case 'U':
        if (l[i].x - 1 > 0) {
          l[i + 1].x = l[i].x - 1;
        }
        break;
      case 'D':
        if (l[i].x + 1 <= x) {
          l[i + 1].x = l[i].x + 1;
        }
        break;
      case 'L':
        if (l[i].y - 1 > 0) {
          l[i + 1].y = l[i].y - 1;
        }
        break;
      case 'R':
        if (l[i].y + 1 <= y) {
          l[i + 1].y = l[i].y + 1;
        }
        break;
      default:
        break;
    }
  }
  m[x0][y0] = true;
  cout << "1 ";
  for (int i = 0; i < s.length() - 1; i++) {
    if (m[l[i + 1].x][l[i + 1].y]) {
      cout << "0 ";
    } else
      cout << "1 ";
    m[l[i + 1].x][l[i + 1].y] = true;
  }
  int ans = 0;
  for (int i = 1; i <= x; i++) {
    for (int j = 1; j <= y; j++) {
      if (!m[i][j]) {
        ans++;
      }
    }
  }
  cout << ans;
  return 0;
}
