#include <bits/stdc++.h>
using namespace std;
const int MX = 1e6 + 5;
const int INF = 0x3f3f3f3f;
int n;
char S[MX];
int U[MX], D[MX];
long long Usum[MX], Dsum[MX];
long long checkU(int pos, int num) {
  int l = 1, r = pos, m;
  while (l <= r) {
    m = (l + r) >> 1;
    if (U[pos] - U[m - 1] >= num)
      l = m + 1;
    else
      r = m - 1;
  }
  return Usum[pos] - Usum[l - 2];
}
long long checkD(int pos, int num) {
  int l = pos, r = n, m;
  while (l <= r) {
    m = (l + r) >> 1;
    if (D[pos] - D[m + 1] >= num)
      r = m - 1;
    else
      l = m + 1;
  }
  return Dsum[pos] - Dsum[r + 2];
}
long long solve(int pos) {
  long long ret = 0;
  if (S[pos] == 'U') {
    if (U[pos] > D[pos]) {
      long long Usum = checkU(pos, D[pos] + 1);
      long long Dsum = ::Dsum[pos];
      ret = 2 * Dsum - (2 * Usum - pos) + n + 1;
    } else {
      long long Usum = ::Usum[pos];
      long long Dsum = checkD(pos, U[pos]);
      ret = 2 * Dsum - (2 * Usum - pos);
    }
  } else {
    if (D[pos] > U[pos]) {
      long long Usum = ::Usum[pos];
      long long Dsum = checkD(pos, U[pos] + 1);
      ret = 2 * Dsum - pos - 2 * Usum;
    } else {
      long long Usum = checkU(pos, D[pos]);
      long long Dsum = ::Dsum[pos];
      ret = 2 * Dsum - pos + n + 1 - 2 * Usum;
    }
  }
  return ret;
}
int main() {
  scanf("%d%s", &n, S + 1);
  for (int i = 1; i <= n; i++) {
    if (S[i] == 'U') {
      U[i] = U[i - 1] + 1;
      Usum[i] = Usum[i - 1] + i;
    } else
      U[i] = U[i - 1], Usum[i] = Usum[i - 1];
  }
  for (int i = n; i >= 1; i--) {
    if (S[i] == 'D') {
      D[i] = D[i + 1] + 1;
      Dsum[i] = Dsum[i + 1] + i;
    } else
      D[i] = D[i + 1], Dsum[i] = Dsum[i + 1];
  }
  for (int i = 1; i <= n; i++) {
    printf("%I64d%c", solve(i), i == n ? '\n' : ' ');
  }
  return 0;
}
