#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)(1e6) + 2;
const int inf = (int)(1e9) + 7;
char a[maxn];
long long n, upref[maxn], usuff[maxn], dpref[maxn], dsuff[maxn], L[maxn],
    R[maxn];
int dpos[maxn], upos[maxn], ucnt, dcnt;
long long ans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    upref[i] = upref[i - 1] + (a[i] == 'U');
    dpref[i] = dpref[i - 1] + (a[i] == 'D');
    L[i] = L[i - 1] + (a[i] == 'U' ? n - i + 1 : 0);
    if (a[i] == 'D') dpos[++dcnt] = i;
  }
  for (int i = n; i >= 1; i--) {
    dsuff[i] = dsuff[i + 1] + (a[i] == 'D');
    usuff[i] = usuff[i + 1] + (a[i] == 'U');
    R[i] = R[i + 1] + (a[i] == 'D' ? i : 0);
    if (a[i] == 'U') upos[++ucnt] = i;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 'U') {
      if (dsuff[i + 1] == 0)
        ans = n - i + 1;
      else if (upref[i - 1] < dsuff[i + 1]) {
        ans = ((R[i + 1] - R[dpos[dpref[i - 1] + upref[i - 1] + 1] + 1] -
                (upref[i - 1] + 1) * i) +
               (L[i - 1] - upref[i - 1] * (n - i + 1))) *
                  2 +
              i;
      } else {
        ans = ((L[i - 1] - L[upos[usuff[i] + dsuff[i + 1]] - 1] -
                dsuff[i + 1] * (n - i + 1)) +
               (R[i + 1] - dsuff[i + 1] * i)) *
                  2 +
              n - i + 1;
      }
    } else {
      if (upref[i - 1] == 0)
        ans = i;
      else if (upref[i - 1] > dsuff[i + 1]) {
        ans = ((L[i - 1] - L[upos[(usuff[i + 1] + dsuff[i + 1] + 1)] - 1] -
                (dsuff[i + 1] + 1) * (n - i + 1)) +
               (R[i + 1] - dsuff[i + 1] * i)) *
                  2 +
              n - i + 1;
      } else {
        ans = ((R[i + 1] - R[dpos[dpref[i] + upref[i - 1]] + 1] -
                upref[i - 1] * i) +
               (L[i - 1] - upref[i - 1] * (n - i + 1))) *
                  2 +
              i;
      }
    }
    cout << ans << ' ';
  }
  return 0;
}
