#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
char s[N];
int a[N], p[2][N], m[2][N], c[2];
long long dp[2][N];
int main() {
  int n, i, j;
  scanf("%d", &n);
  scanf("%s", s + 1);
  for (i = 1; i <= n; i++) a[i] = s[i] == 'U' ? 1 : 0;
  for (i = 1; i <= n; i++) {
    p[1][i] = p[1][i - 1] + a[i];
    if (a[i] == 1) {
      m[1][++c[1]] = i;
    }
  }
  for (i = n; i >= 1; i--) {
    p[0][i] = p[0][i + 1] + (1 - a[i]);
    if (a[i] == 0) m[0][++c[0]] = i;
  }
  for (i = 1; i <= n; i++) {
    dp[1][i] = dp[1][i - 1] + p[1][i - 1];
  }
  for (i = n; i >= 1; i--) {
    dp[0][i] = dp[0][i + 1] + p[0][i + 1];
  }
  long long ans = 0;
  int s0, s1, ss, k;
  for (i = 1; i <= n; i++) {
    ans = 0;
    s0 = p[0][i];
    s1 = p[1][i];
    if (a[i] == 1) {
      if (p[1][i] > p[0][i]) {
        ans += n + 1 - i;
        s1 -= 1;
      } else
        ans += i;
    } else {
      if (p[0][i] > p[1][i]) {
        ans += i;
        s0 -= 1;
      } else
        ans += n + 1 - i;
    }
    ss = min(s0, s1);
    k = m[1][s1 - ss + 1];
    ans = ans + 1ll * 2 * (dp[1][i] - dp[1][k] - 1ll * (i - k) * (s1 - ss));
    k = m[0][s0 - ss + 1];
    ans = ans + 1ll * 2 * (dp[0][i] - dp[0][k] - 1ll * (k - i) * (s0 - ss));
    printf("%I64d ", ans);
  }
}
