#include <bits/stdc++.h>
using namespace std;
int visited[1001][1001];
int main() {
  int x, y, x0, y0, curx, cury, l, i, j, ctr = 0;
  string str;
  cin >> x >> y >> x0 >> y0;
  cin >> str;
  l = str.length();
  cout << "1"
       << " ";
  curx = x0;
  cury = y0;
  visited[curx][cury] = 1;
  for (i = 0; i < l - 1; i++) {
    if (str[i] == 'U') {
      if (curx - 1 >= 1) {
        curx--;
        if (visited[curx][cury])
          cout << "0"
               << " ";
        else
          cout << "1"
               << " ";
        visited[curx][cury] = 1;
        ctr++;
      } else
        cout << "0"
             << " ";
    } else if (str[i] == 'D') {
      if (curx + 1 <= x) {
        curx++;
        if (visited[curx][cury])
          cout << "0"
               << " ";
        else
          cout << "1"
               << " ";
        visited[curx][cury] = 1;
        ctr++;
      } else
        cout << "0"
             << " ";
    } else if (str[i] == 'R') {
      if (cury + 1 <= y) {
        cury++;
        if (visited[curx][cury])
          cout << "0"
               << " ";
        else
          cout << "1"
               << " ";
        visited[curx][cury] = 1;
        ctr++;
      } else
        cout << "0"
             << " ";
    } else {
      if (cury - 1 >= 1) {
        cury--;
        if (visited[curx][cury])
          cout << "0"
               << " ";
        else
          cout << "1"
               << " ";
        visited[curx][cury] = 1;
        ctr++;
      } else
        cout << "0"
             << " ";
    }
  }
  ctr = 0;
  for (i = 1; i <= x; i++) {
    for (j = 1; j <= y; j++) {
      if (visited[i][j]) ctr++;
    }
  }
  if (str[l - 1] == 'U') {
    if (curx - 1 >= 1) {
      cout << x * y - ctr;
    } else
      cout << "0"
           << " ";
  } else if (str[l - 1] == 'D') {
    if (curx + 1 <= x) {
      cout << x * y - ctr;
    } else
      cout << "0"
           << " ";
  } else if (str[l - 1] == 'R') {
    if (cury + 1 <= y) {
      cout << x * y - ctr;
    } else
      cout << "0"
           << " ";
  } else {
    if (cury - 1 >= 1) {
      cout << x * y - ctr;
    } else
      cout << "0"
           << " ";
  }
  return 0;
}
