#include <bits/stdc++.h>
using namespace std;
int main() {
  long long dx[500], dy[500];
  dx[int('U')] = -1;
  dy[int('U')] = 0;
  dx[int('D')] = 1;
  dy[int('D')] = 0;
  dx[int('L')] = 0;
  dy[int('L')] = -1;
  dx[int('R')] = 0;
  dy[int('R')] = 1;
  long long x[4];
  for (int i = 0; i < 4; ++i) {
    cin >> x[i];
  }
  for (int i = 2; i < 4; ++i) {
    x[i] -= 1;
  }
  char str[100009];
  cin >> str;
  bool visited[x[0]][x[1]];
  for (int i = 0; i < x[0]; ++i) {
    for (int j = 0; j < x[1]; ++j) {
      visited[i][j] = false;
    }
  }
  for (int i = 0; i < strlen(str); ++i) {
    if (visited[x[2]][x[3]]) {
      cout << 0 << " ";
    } else {
      cout << 1 << " ";
    }
    visited[x[2]][x[3]] = true;
    if (x[2] + dx[int(str[i])] >= 0 && x[2] + dx[int(str[i])] < x[0]) {
      if (x[3] + dy[int(str[i])] >= 0 && x[3] + dy[int(str[i])] < x[1]) {
        x[2] = x[2] + dx[int(str[i])];
        x[3] = x[3] + dy[int(str[i])];
      }
    }
  }
  long long final = x[0] * x[1];
  for (int i = 0; i < x[0]; ++i) {
    for (int j = 0; j < x[1]; ++j) {
      final -= visited[i][j];
    }
  }
  cout << final;
  return 0;
}
