#include <bits/stdc++.h>
using namespace std;
const int N = 1000 * 1000 + 5;
long long ans[N], pr[N], sf[N];
int cpr[N], csf[N];
char a[N];
int main() {
  int n, i, cntUpLeft = 0, cntUpRight = 0;
  scanf("%d\n", &n);
  for (i = 1; i <= n; i++) {
    scanf("%c", &a[i]);
  }
  cpr[0] = 0;
  csf[n + 1] = 0;
  for (i = 1; i <= n; i++) {
    cpr[i] = cpr[i - 1];
    if (a[i] == 'U') {
      cpr[i]++;
    }
    csf[n - i + 1] = csf[n - i + 2];
    if (a[n - i + 1] == 'U') {
      csf[n - i + 1]++;
    }
  }
  pr[0] = 0;
  sf[0] = 0;
  for (i = 1; i <= n; i++) {
    if (a[i] == 'U') {
      cntUpLeft++;
      pr[cntUpLeft] = pr[cntUpLeft - 1] + i;
    }
    if (a[n - i + 1] == 'D') {
      cntUpRight++;
      sf[cntUpRight] = sf[cntUpRight - 1] + n - i + 1;
    }
  }
  int cnt, j;
  for (i = 1; i <= n; i++) {
    if (a[i] == 'U') {
      cnt = min(cpr[i - 1], n - i - csf[i + 1]);
      j = cpr[i - 1] - cnt;
      if (cpr[i - 1] >= n - i - csf[i + 1]) {
        ans[i] += (i * 1LL * cnt - (pr[cpr[i - 1]] - pr[j]));
        ans[i] += (sf[n - i - csf[i + 1]] - sf[n - i - csf[i + 1] - cnt] -
                   i * 1LL * cnt);
        ans[i] *= 2;
        ans[i] += n - i + 1;
      } else {
        ans[i] += (i * 1LL * cnt - (pr[cpr[i - 1]] - pr[j]));
        ans[i] += (sf[n - i - csf[i + 1]] - sf[n - i - csf[i + 1] - (cnt + 1)] -
                   i * 1LL * (cnt + 1));
        ans[i] *= 2;
        ans[i] += i;
      }
    } else {
      cnt = min(cpr[i - 1], n - i - csf[i + 1]);
      if (cpr[i - 1] > n - i - csf[i + 1]) {
        j = cpr[i - 1] - (cnt + 1);
        ans[i] += (i * 1LL * (cnt + 1) - (pr[cpr[i - 1]] - pr[j]));
        ans[i] += (sf[n - i - csf[i + 1]] - sf[n - i - csf[i + 1] - cnt] -
                   i * 1LL * cnt);
        ans[i] *= 2;
        ans[i] += n - i + 1;
      } else {
        j = cpr[i - 1] - cnt;
        ans[i] += (i * 1LL * cnt - (pr[cpr[i - 1]] - pr[j]));
        ans[i] += (sf[n - i - csf[i + 1]] - sf[n - i - csf[i + 1] - cnt] -
                   i * 1LL * cnt);
        ans[i] *= 2;
        ans[i] += i;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    printf("%I64d ", ans[i]);
  }
  return 0;
}
