#include <bits/stdc++.h>
using namespace std;
void mov(int &x, int &y, char c, int X, int Y);
int main(void) {
  int X, Y, x, y, k = 0;
  cin >> X >> Y >> x >> y;
  string commands;
  cin >> commands;
  int field[X][Y];
  int sz = commands.size();
  for (int i = 0; i < X; i++) {
    for (int j = 0; j < Y; j++) {
      field[i][j] = sz;
    }
  }
  int result[sz + 1];
  for (int i = 0; i < sz + 1; i++) result[i] = 0;
  field[x - 1][y - 1] = 0;
  for (auto c : commands) {
    mov(x, y, c, X, Y);
    k++;
    if (field[x - 1][y - 1] == sz) field[x - 1][y - 1] = k;
  }
  for (int i = 0; i < X; i++) {
    for (int j = 0; j < Y; j++) {
      result[field[i][j]]++;
    }
  }
  for (auto t : result) {
    printf("%d ", t);
  }
  return 0;
}
void mov(int &x, int &y, char c, int X, int Y) {
  switch (c) {
    case 'L':
      y--, (y < 1 ? y = 1 : y);
      break;
    case 'R':
      y++, (y > Y ? y = Y : y);
      break;
    case 'U':
      x--, (x < 1 ? x = 1 : x);
      break;
    case 'D':
      x++, (x > X ? x = X : x);
      break;
  }
}
