#include <bits/stdc++.h>
using namespace std;
int vis[501][501];
int xM, yM;
bool check(int x, int y) {
  if (x == 0 || y == 0 || x > xM || y > yM) return false;
  return true;
}
int main() {
  int x, y, x0, y0;
  cin >> xM >> yM >> x0 >> y0;
  int boom = 0;
  memset(vis, 0, sizeof vis);
  string s;
  cin >> s;
  x = x0;
  y = y0;
  vis[x][y] = 1;
  cout << "1 ";
  for (int i = 0; i < (int)s.length() - 1; ++i) {
    if (s[i] == 'U' && check(x - 1, y)) {
      x = x - 1;
      if (!vis[x][y]) {
        boom++;
        cout << "1 ";
      } else
        cout << "0 ";
      vis[x][y] = 1;
    } else if (s[i] == 'U' && !check(x - 1, y))
      cout << "0 ";
    if (s[i] == 'D' && check(x + 1, y)) {
      x = x + 1;
      if (!vis[x][y]) {
        boom++;
        cout << "1 ";
      } else
        cout << "0 ";
      vis[x][y] = 1;
    } else if (s[i] == 'D' && !check(x + 1, y))
      cout << "0 ";
    if (s[i] == 'R' && check(x, y + 1)) {
      y = y + 1;
      if (!vis[x][y]) {
        boom++;
        cout << "1 ";
      } else
        cout << "0 ";
      vis[x][y] = 1;
    } else if (s[i] == 'R' && !check(x, y + 1))
      cout << "0 ";
    if (s[i] == 'L' && check(x, y - 1)) {
      y = y - 1;
      if (!vis[x][y]) {
        boom++;
        cout << "1 ";
      } else
        cout << "0 ";
      vis[x][y] = 1;
    } else if (s[i] == 'L' && !check(x, y - 1))
      cout << "0 ";
  }
  bool flag = false;
  int i = s.length() - 1;
  if (s[i] == 'U' && check(x - 1, y)) {
    x = x - 1;
    if (!vis[x][y]) {
      boom++;
      flag = true;
    }
  }
  if (s[i] == 'D' && check(x + 1, y)) {
    x = x + 1;
    if (!vis[x][y]) {
      boom++;
      flag = true;
    }
  }
  if (s[i] == 'R' && check(x, y + 1)) {
    y = y + 1;
    if (!vis[x][y]) {
      boom++;
      flag = true;
    }
  }
  if (s[i] == 'L' && check(x, y - 1)) {
    y = y - 1;
    if (!vis[x][y]) {
      boom++;
      flag = true;
    }
  }
  if (flag)
    cout << xM * yM - boom;
  else
    cout << xM * yM - boom - 1;
  return 0;
}
