#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int x, y, x1, y1, tot, cur_x, cur_y;
  cin >> x >> y >> x1 >> y1;
  cur_x = x1 - 1;
  cur_y = y1 - 1;
  tot = x * y;
  int a[x][y];
  for (int i = 0; i < x; i++)
    for (int j = 0; j < y; j++) a[i][j] = 0;
  string s;
  cin >> s;
  if (s.size() == 0) {
    cout << tot << " ";
  } else {
    cout << "1 ";
    a[cur_x][cur_y]++;
    tot--;
  }
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] == 'U') {
      cur_x = (cur_x - 1 >= 0) ? cur_x - 1 : 0;
    }
    if (s[i] == 'D') {
      cur_x = (cur_x + 1 < x) ? cur_x + 1 : x - 1;
    }
    if (s[i] == 'R') {
      cur_y = (cur_y + 1 < y) ? cur_y + 1 : y - 1;
    }
    if (s[i] == 'L') {
      cur_y = (cur_y - 1 >= 0) ? cur_y - 1 : 0;
    }
    if (a[cur_x][cur_y] == 0 || i == s.size() - 1) {
      if (i == s.size() - 1) {
        cout << tot << " ";
      } else {
        cout << "1 ";
        tot--;
        a[cur_x][cur_y] = 1;
      }
    } else
      cout << "0 ";
  }
  cout << endl;
  return 0;
}
