#include <bits/stdc++.h>
using namespace std;
bool maze[505][505] = {{0}};
bool explore[505][505] = {{0}};
int main() {
  long long n, m, x, y;
  cin >> n >> m >> x >> y;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) maze[i][j] = 1;
  string s;
  cin >> s;
  long long c = 1;
  cout << "1 ";
  explore[x][y] = 1;
  for (long long i = 0; i <= (long long)s.size() - 1; i++) {
    if (i == s.size() - 1) break;
    long long lastx = x, lasty = y;
    if (s[i] == 'U')
      x--;
    else if (s[i] == 'D')
      x++;
    else if (s[i] == 'L')
      y--;
    else if (s[i] == 'R')
      y++;
    if (!maze[x][y]) {
      cout << "0 ";
      x = lastx;
      y = lasty;
    } else {
      if (explore[x][y]) {
        cout << "0 ";
      } else {
        explore[x][y] = 1;
        cout << "1 ";
        c++;
      }
    }
  }
  cout << n * m - c;
}
