#include <bits/stdc++.h>
using namespace std;
char s[1000005], u, d;
long long prefnd[1000005], prefnu[1000005];
int cntnd[1000005], cntnu[1000005];
int main() {
  int n;
  scanf("%d", &n);
  u = 'U';
  d = 'D';
  s[0] = u;
  scanf("%s", (s + 1));
  s[n + 1] = d;
  prefnd[0] = 0;
  prefnu[0] = 0;
  cntnd[0] = 0;
  cntnu[0] = 1;
  for (int i = 1; i <= n + 1; i++) {
    prefnd[i] = prefnd[i - 1];
    prefnu[i] = prefnu[i - 1];
    cntnd[i] = cntnd[i - 1];
    cntnu[i] = cntnu[i - 1];
    if (s[i] == u)
      prefnu[i] += i, cntnu[i]++;
    else
      prefnd[i] += i, cntnd[i]++;
  }
  for (int i = 1; i <= n; i++) {
    long long ans;
    if ((cntnd[n] - cntnd[i - 1]) <= (cntnu[i - 1] - cntnu[0])) {
      int terms = cntnd[n] - cntnd[i - 1];
      int l = 0, r = i - 1;
      while (l != r) {
        int mid = (l + r + 1) >> 1;
        int now = cntnu[i - 1];
        if (mid) now -= cntnu[mid - 1];
        if (now >= terms)
          l = mid;
        else
          r = mid - 1;
      }
      long long p = prefnu[i - 1];
      if (l) p -= prefnu[l - 1];
      if (!terms) p = 0;
      ans = 2 * (prefnd[n + 1] - prefnd[i - 1] - p) - (i + n + 1);
    } else {
      int terms = cntnu[i - 1];
      int l = i, r = n + 1;
      while (l != r) {
        int mid = (l + r) >> 1;
        int now = cntnd[mid] - cntnd[i - 1];
        if (now >= terms)
          r = mid;
        else
          l = mid + 1;
      }
      long long p = prefnd[l] - prefnd[i - 1];
      ans = 2 * (p - prefnu[i - 1]) - i;
    }
    printf("%lld ", ans);
  }
}
