#include <bits/stdc++.h>
using namespace std;
inline long long getnum() {
  char c = getchar();
  long long num, sign = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') sign = -1;
  for (num = 0; c >= '0' && c <= '9';) {
    c -= '0';
    num = num * 10 + c;
    c = getchar();
  }
  return num * sign;
}
char S[1000006];
int cnt[2][1000006];
long long lft[2][1000006], rght[2][1000006];
int main() {
  int n = getnum();
  gets(S + 1);
  for (int i = 1; i <= n; i++) {
    if (S[i] == 'U')
      cnt[0][i]++;
    else
      cnt[1][i]++;
    cnt[0][i] += cnt[0][i - 1];
    cnt[1][i] += cnt[1][i - 1];
  }
  for (int i = 1; i <= n; i++) {
    if (S[i] == 'U')
      lft[0][i] += i;
    else
      lft[1][i] += i;
    lft[0][i] += lft[0][i - 1];
    lft[1][i] += lft[1][i - 1];
  }
  for (int i = n; i >= 1; i--) {
    if (S[i] == 'U')
      rght[0][i] += n - i + 1;
    else
      rght[1][i] += n - i + 1;
    rght[0][i] += rght[0][i + 1];
    rght[1][i] += rght[1][i + 1];
  }
  for (int i = 1; i <= n; i++) {
    long long ans = 0;
    int x = 1;
    if (S[i] == 'U') {
      if (cnt[0][i - 1] < cnt[1][n] - cnt[1][i]) {
        int ld = lower_bound(cnt[1] + 1, cnt[1] + n + 1,
                             1 + cnt[1][i] + cnt[0][i - 1]) -
                 cnt[1];
        ans += (rght[0][1] - rght[0][i + 1]) - (rght[1][i] - rght[1][ld + 1]);
        ans += (lft[1][ld] - lft[1][i]) - lft[0][i - 1];
      } else {
        int lu = lower_bound(cnt[0] + 1, cnt[0] + n + 1,
                             cnt[0][i] - (cnt[1][n] - cnt[1][i])) -
                 cnt[0];
        ans += (rght[0][lu] - rght[0][i + 1]) - rght[1][i];
        ans += (lft[1][n] - lft[1][i]) - (lft[0][i - 1] - lft[0][lu - 1]);
      }
    } else {
      if (cnt[0][i - 1] <= cnt[1][n] - cnt[1][i]) {
        int ld =
            lower_bound(cnt[1] + 1, cnt[1] + n + 1, cnt[1][i] + cnt[0][i - 1]) -
            cnt[1];
        ans += (lft[1][ld] - lft[1][i - 1]) - lft[0][i];
        ans += (rght[0][1] - rght[0][i]) - (rght[1][i + 1] - rght[1][ld + 1]);
      } else {
        int lu = lower_bound(cnt[0] + 1, cnt[0] + n + 1,
                             cnt[0][i] - (cnt[1][n] - cnt[1][i])) -
                 cnt[0];
        ans += (lft[1][n] - lft[1][i - 1]) - (lft[0][i] - lft[0][lu - 1]);
        ans += (rght[0][lu] - rght[0][i]) - rght[1][i + 1];
      }
    }
    printf("%lld ", ans);
  }
}
