#include <bits/stdc++.h>
using namespace std;
int dr[] = {1, 0, -1, 0, -1, -1, 1, 1};
int dc[] = {0, -1, 0, 1, -1, 1, -1, 1};
const int MAX = 1e6 + 7;
const int MOD = 1e9 + 7;
class unionFind {
  vector<int> rank, parent;

 public:
  unionFind(int n) {
    rank.resize(n);
    parent.resize(n);
    for (int i = 0; i < n; ++i) rank[i] = 0, parent[i] = i;
  }
  int find_set(int i) {
    return (parent[i] == i) ? i : (parent[i] = find_set(parent[i]));
  }
  bool isSameSet(int i, int j) { return find_set(i) == find_set(j); }
  bool union_set(int i, int j) {
    if (!isSameSet(i, j)) {
      int x = find_set(i), y = find_set(j);
      if (rank[x] > rank[y])
        parent[y] = x;
      else {
        parent[x] = y;
        if (rank[x] == rank[y]) rank[y]++;
      }
      return 1;
    }
    return 0;
  }
};
int n, m, i, j;
string s;
int grid[507][507];
int main() {
  cin >> n >> m >> i >> j >> s;
  i--, j--;
  grid[i][j] = 1;
  cout << 1 << " ";
  for (int k = 0; k < s.length(); ++k) {
    if (s[k] == 'U' && i - 1 >= 0) i--;
    if (s[k] == 'D' && i + 1 < n) i++;
    if (s[k] == 'L' && j - 1 >= 0) j--;
    if (s[k] == 'R' && j + 1 < m) j++;
    if (k == s.length() - 1) {
      int ans = 0;
      for (int u = 0; u < n; ++u)
        for (int v = 0; v < m; ++v) ans += (!grid[u][v]);
      cout << ans << "\n";
    } else {
      if (!grid[i][j])
        cout << 1 << " ";
      else
        cout << 0 << " ";
    }
    grid[i][j] = 1;
  }
}
