#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 7 + 1000000;
char str[MAX_N];
int main() {
  int n;
  scanf("%d", &n);
  scanf(" %s", str + 1);
  int numu = 0;
  int numd = 0;
  int l = 0, r = 0;
  long long suml = 0, sumr = 0;
  for (int i = 1; i <= n; i++) {
    suml += 2 * numu;
    sumr -= 2 * numd;
    if (str[i - 1] == 'U') numu++, suml++;
    if (str[i - 1] == 'D') numd--, sumr++;
    for (; numd - 1 < numu && r < n;)
      if (str[++r] == 'D') numd++, sumr += 2 * (r - (i - 1)) - 1;
    for (; numd < numu && r == n;)
      if (str[++l] == 'U') numu--, suml -= 2 * (i - l) - 1;
    if (numd - 1 == numu)
      printf("%I64d\n", suml + sumr + i - 1);
    else
      printf("%I64d\n", suml + sumr + n - i + 1);
  }
}
