#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
char a[maxn];
long long n, ucnt = 0, dcnt = 0, u[maxn], d[maxn], su[maxn], sd[maxn];
int main() {
  scanf("%d", &n);
  scanf("%s", a + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] == 'U')
      u[++ucnt] = i;
    else
      d[++dcnt] = i;
  }
  for (int i = 1; i <= ucnt; i++) su[i] = su[i - 1] + u[i];
  for (int i = 1; i <= dcnt; i++) sd[i] = sd[i - 1] + d[i];
  for (int i = 1; i <= n; i++) {
    if (a[i] == 'U') {
      long long p = lower_bound(u + 1, u + ucnt + 1, i) - u;
      long long unum = p - 1, dnum = n - i - (ucnt - p);
      if (dnum <= unum) {
        long long ans =
            (sd[dcnt] - sd[dcnt - dnum] - (long long)i * (dnum)) * 2 + n - i +
            1;
        ans += (i * (dnum)-su[unum] + su[unum - dnum]) * 2;
        cout << ans << " ";
      } else {
        long long dbefore = i - 1 - unum;
        long long ans = ((i)*unum - su[unum]) * 2 + i;
        ans += (sd[dbefore + unum + 1] - sd[dbefore] - i * (unum + 1)) * 2;
        cout << ans << " ";
      }
    } else {
      long long p = lower_bound(d + 1, d + dcnt + 1, i) - d;
      long long unum = i - p, dnum = dcnt - p;
      if (unum <= dnum) {
        long long dbefore = i - 1 - unum;
        long long ans = ((i)*unum - su[unum]) * 2 + i;
        ans += (sd[dbefore + unum + 1] - sd[dbefore] - i * (unum + 1)) * 2;
        cout << ans << " ";
      } else {
        long long ans =
            (sd[dcnt] - sd[dcnt - dnum] - (long long)i * (dnum)) * 2 + n - i +
            1;
        ans += (i * (dnum + 1) - su[unum] + su[unum - dnum - 1]) * 2;
        cout << ans << " ";
      }
    }
  }
}
