#include <bits/stdc++.h>
using namespace std;
int main() {
  int x0, y0, x, y;
  string s;
  scanf("%d %d %d %d", &x, &y, &x0, &y0);
  cin >> s;
  bool visited[600][600] = {};
  int not_visited = x * y;
  puts("1");
  visited[x0][y0] = true;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == 'U' && x0 - 1 >= 1)
      x0 -= 1;
    else if (s[i] == 'D' && x0 + 1 <= x)
      x0 += 1;
    else if (s[i] == 'L' && y0 - 1 >= 1)
      y0 -= 1;
    else if (s[i] == 'R' && y0 + 1 <= y)
      y0 += 1;
    if (!visited[x0][y0])
      not_visited--, puts("1");
    else
      puts("0");
    visited[x0][y0] = true;
  }
  if (not_visited == 0)
    puts("0");
  else
    cout << not_visited - 1 << "\n";
  return 0;
}
