#include <bits/stdc++.h>
using namespace std;
int N;
char S[1000002];
int A_[1000001], B_[1000001];
int A[1000001], B[1000001];
long long FA[1000001], FB[1000001];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> N >> (S + 1);
  for (int i = 1; i <= N; ++i) {
    A[i] = A[i - 1];
    FA[i] = FA[i - 1];
    B[i] = B[i - 1];
    FB[i] = FB[i - 1];
    if (S[i] == 'U') {
      A_[++A[i]] = i;
      FA[i] += i;
    } else {
      B_[++B[i]] = i;
      FB[i] += i;
    }
  }
  for (int i = 1; i <= N; ++i) {
    long long w;
    if (S[i] == 'U') {
      int ka = A[i] - A[0];
      int kb = B[N] - B[i];
      if (ka > kb)
        w = N - i + 1 + (FB[N] - FB[i] - FA[i - 1] + FA[A_[A[i] - kb - 1]]) * 2;
      else
        w = i + (FB[B_[B[i] + ka]] - FB[i] - FA[i] + FA[0]) * 2;
    } else {
      int ka = A[i - 1] - A[0];
      int kb = B[N] - B[i - 1];
      if (kb > ka)
        w = i + (FB[B_[B[i] + ka]] - FB[i] - FA[i] + FA[0]) * 2;
      else
        w = N - i + 1 + (FB[N] - FB[i - 1] - FA[i] + FA[A_[A[i] - kb]]) * 2;
    }
    cout << w;
    if (i < N) cout << ' ';
  }
  cout << endl;
  return 0;
}
