#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 1;
const int MAXX = 5e2 + 1;
int X, Y, x0_, y0_;
string s;
pair<int, int> next_(int x, int y, char c) {
  if (c == 'U') return make_pair(x - 1, y);
  if (c == 'D') return make_pair(x + 1, y);
  if (c == 'L') return make_pair(x, y - 1);
  if (c == 'R') return make_pair(x, y + 1);
}
bool check(int x, int y) { return x >= 0 && x < X && y >= 0 && y < Y; }
bool check(pair<int, int> a) { return check(a.first, a.second); }
int answer[MAXN];
bool was[MAXX][MAXX];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> X >> Y >> x0_ >> y0_;
  x0_--, y0_--;
  cin >> s;
  memset(answer, 0, sizeof answer);
  for (int i = 0; i < MAXX; i++)
    for (int j = 0; j < MAXX; j++) was[i][j] = false;
  int curx = x0_, cury = y0_;
  for (int i = 0; i <= int(s.length()); i++) {
    if (!was[curx][cury]) {
      was[curx][cury] = true;
      answer[i]++;
    }
    if (i != int(s.length()))
      if (check(next_(curx, cury, s[i])))
        curx = next_(curx, cury, s[i]).first,
        cury = next_(curx, cury, s[i]).second;
  }
  for (int i = 0; i < X; i++)
    for (int j = 0; j < Y; j++)
      if (!was[i][j]) answer[int(s.length())]++;
  for (int i = 0; i <= int(s.length()); i++) cout << answer[i] << " ";
  cout << endl;
  return 0;
}
