#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000007, maxn = 444444;
long long gcd(long long a, long long b) { return (a ? gcd(b % a, a) : b); }
long long power(long long a, long long n) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
    }
    n >>= 1;
    a *= a;
  }
  return p;
}
using namespace std;
bool boli;
string konkor;
long long n, m, y, shahsavari;
long long kom, poot;
bool visited[1000][1000];
int main() {
  cin >> n >> m >> kom >> poot >> konkor;
  shahsavari = n * m;
  for (long long(i) = 0; (i) < (konkor.size()); (i)++) {
    if (visited[kom][poot])
      cout << 0 << " ";
    else {
      cout << 1 << " ";
      shahsavari--;
      visited[kom][poot]++;
    }
    if (konkor[i] == 'R' && poot < m)
      poot++;
    else if (konkor[i] == 'L' && poot > 1)
      poot--;
    else if (konkor[i] == 'U' && kom > 1)
      kom--;
    else if (konkor[i] == 'D' && kom < n)
      kom++;
  }
  cout << shahsavari;
}
