#include <bits/stdc++.h>
using namespace std;
const int nmax = 1000002;
int khong[nmax], mot[nmax], n0, n1;
long long s0[nmax], s1[nmax];
char s[1000000];
void show() {
  cout << "Khong: ";
  for (int i = 1; i <= n0; i++) cout << khong[i] << " ";
  cout << endl;
  cout << "Mot: ";
  for (int i = 1; i <= n1; i++) cout << mot[i] << " ";
  cout << endl;
}
int main() {
  int n;
  cin >> n;
  scanf("%s", s);
  long long sum0, sum1;
  for (int i = n - 1; i >= 0; i--)
    if (s[i] == 'D') {
      khong[++n0] = i;
      s0[n0] = s0[n0 - 1] + i;
      sum0 += i;
    }
  for (int i = 0; i < n; i++) {
    n0 -= s[i] == 'D';
    int nn = min(n0, n1);
    long long res = (s0[n0] - s0[n0 - nn] - s1[n1] + s1[n1 - nn]) * 2;
    if (s[i] == 'U') {
      if (n0 == nn)
        res += n - i;
      else
        res += (khong[n0 - nn] - i) * 2 + i + 1;
      mot[++n1] = i;
      s1[n1] = i + s1[n1 - 1];
    } else {
      if (n1 == nn)
        res += i + 1;
      else
        res += (i - mot[n1 - nn]) * 2 + n - i;
    }
    printf("%I64d ", res);
  }
}
