#include <bits/stdc++.h>
const long double PI = 3.141592653589793238462643383279502884L;
using namespace std;
const int maxN = 20 * 100 * 100 + 15;
bool u[503][503];
int main() {
  ios_base::sync_with_stdio(false);
  int x, y, x0, y0;
  string str;
  cin >> x >> y >> x0 >> y0 >> str;
  int ptr = 0;
  int sum = 0;
  while (ptr <= str.length()) {
    if (ptr != str.length()) {
      if (u[x0][y0] == false) {
        cout << 1 << ' ';
        sum++;
        u[x0][y0] = true;
      } else
        cout << 0 << ' ';
      if (str[ptr] == 'U') x0 = max(1, x0 - 1);
      if (str[ptr] == 'L') y0 = max(1, y0 - 1);
      if (str[ptr] == 'D') x0 = min(x, x0 + 1);
      if (str[ptr] == 'R') y0 = min(y, y0 + 1);
      ptr++;
    } else {
      cout << x * y - sum << endl;
      ptr++;
    }
  }
  return 0;
}
