#include <bits/stdc++.h>
int setBit(int N, int pos) { return N = N | (1 << pos); }
int resetBit(int N, int pos) { return N = N & ~(1 << pos); }
bool checkBit(int N, int pos) { return (bool)(N & (1 << pos)); }
using namespace std;
int fx[] = {+0, +0, +1, -1, -1, +1, -1, +1};
int fy[] = {-1, +1, +0, +0, +1, +1, -1, -1};
const int MAX = 505;
int r, c, len, deadX, deadY;
bool visit[MAX][MAX];
string s;
unordered_map<char, int> dir;
void pre() {
  dir['L'] = 0;
  dir['R'] = 1;
  dir['D'] = 2;
  dir['U'] = 3;
}
inline bool isValid(int x, int y) { return (x >= 0 & x < r && y >= 0 & y < c); }
void dfs(int x, int y, int idx) {
  if (idx == len) {
    deadX = x;
    deadY = y;
    return;
  }
  if (visit[x][y])
    printf("0 ");
  else {
    visit[x][y] = true;
    printf("1 ");
  }
  int d = dir[s[idx]];
  int xx = x + fx[d];
  int yy = y + fy[d];
  if (isValid(xx, yy))
    dfs(xx, yy, idx + 1);
  else
    dfs(x, y, idx + 1);
}
int fuck() {
  int i, j, cnt = 0;
  for (i = 0; i < r; i++) {
    for (j = 0; j < c; j++) {
      if (!visit[i][j]) cnt++;
    }
  }
  return cnt;
}
int main() {
  int x, y;
  pre();
  scanf("%d %d", &r, &c);
  scanf("%d %d", &x, &y);
  cin >> s;
  len = (int)s.size();
  dfs(x - 1, y - 1, 0);
  printf("%d\n", fuck());
  return 0;
}
