#include <bits/stdc++.h>
using namespace std;
const long long N = 1000010;
long long ku[N], kd[N], tl[N], tr[N], U[N], D[N];
vector<char> ans;
int main() {
  long long n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    char c;
    cin >> c;
    ans.push_back(c);
    ku[i] = ku[i - 1] + int(c == 'U');
    kd[i] = kd[i - 1] + int(c == 'D');
    tl[i] = tl[i - 1] + int(c == 'U') * i;
    tr[i] = tr[i - 1] + int(c == 'D') * i;
    U[ku[i]] = tl[i];
    D[kd[i]] = tr[i];
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i - 1] == 'U') {
      int dr = kd[n] - kd[i - 1], ul = ku[i - 1];
      if (ul < dr)
        cout << 2 * (D[kd[i] + ul + 1] - tr[i]) - i - 2 * tl[i - 1] << " ";
      else
        cout << n + 1 + 2 * (tr[n] - tr[i]) - i -
                    2 * (tl[i - 1] - U[ku[i - 1] - dr])
             << " ";
    } else {
      int dr = kd[n] - kd[i], ul = ku[i - 1];
      if (ul <= dr) {
        cout << 2 * (D[kd[i] + ul] - tr[i]) + i - 2 * tl[i - 1] << " ";
      } else {
        cout << n + 1 + 2 * (tr[n] - tr[i]) + i -
                    2 * (tl[i - 1] - U[ku[i - 1] - dr - 1])
             << " ";
      }
    }
  }
}
