#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int x, y, x0, y0;
  cin >> x >> y >> x0 >> y0;
  x0--;
  y0--;
  vector<vector<bool> > vis;
  vis.resize(x, vector<bool>(y));
  string cmd;
  cin >> cmd;
  cout << 1 << ' ';
  vis[x0][y0] = 1;
  for (int i = 0; i < (int)cmd.size(); i++) {
    if (cmd[i] == 'U') x0--;
    if (cmd[i] == 'D') x0++;
    if (cmd[i] == 'L') y0--;
    if (cmd[i] == 'R') y0++;
    if (x0 < 0) x0 = 0;
    if (x0 >= x) x0 = x - 1;
    if (y0 < 0) y0 = 0;
    if (y0 >= y) y0 = y - 1;
    if (i == (int)cmd.size() - 1) {
      int lst = 0;
      for (int first = 0; first < x; first++) {
        for (int second = 0; second < y; second++) {
          if (!vis[first][second] && !(first == x0 && second == y0)) lst++;
        }
      }
      if (vis[x0][y0])
        cout << 0 + lst << ' ';
      else
        cout << 1 + lst << ' ';
      break;
    }
    if (vis[x0][y0])
      cout << 0 << ' ';
    else
      cout << 1 << ' ';
    vis[x0][y0] = 1;
  }
  return 0;
}
