#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const int M = 6e4 + 5;
;
const double eps = 1e-6;
int lu[N], ld[N], ru[N], rd[N];
long long slu[N], sld[N], sru[N], srd[N];
vector<int> D, U;
int n;
char s[N];
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) {
    lu[i] = lu[i - 1] + (s[i] == 'U');
    ld[i] = ld[i - 1] + (s[i] == 'D');
    if (s[i] == 'U')
      U.push_back(i);
    else
      D.push_back(i);
  }
  for (int i = n; i >= 1; i--) {
    ru[i] = ru[i + 1] + (s[i] == 'U');
    rd[i] = rd[i + 1] + (s[i] == 'D');
  }
  for (int i = 0; i < U.size(); i++) slu[i + 1] = slu[i] + U[i];
  for (int i = 0; i < D.size(); i++) sld[i + 1] = sld[i] + D[i];
  for (int i = U.size() - 1, j = 1; i >= 0; i--, j++)
    sru[j] = sru[j - 1] + U[i];
  for (int i = D.size() - 1, j = 1; i >= 0; i--, j++)
    srd[j] = srd[j - 1] + D[i];
  for (int i = 1; i <= n; i++) {
    if (s[i] == 'D') {
      if (lu[i - 1] > rd[i + 1]) {
        long long p = rd[i + 1];
        printf("%I64d ",
               2 * (srd[p] - i * p) + (n + 1 - i) +
                   2 * ((p + 1) * i - slu[lu[i - 1]] + slu[lu[i - 1] - p - 1]));
      } else {
        long long p = lu[i - 1];
        printf("%I64d ", 2 * (i * p - slu[p]) + i +
                             2 * (srd[rd[i + 1]] - srd[rd[i + 1] - p] - p * i));
      }
    } else {
      if (lu[i - 1] >= rd[i + 1]) {
        long long p = rd[i + 1];
        printf("%I64d ", 2 * (srd[p] - i * p) + (n + 1 - i) +
                             2 * (p * i - slu[lu[i - 1]] + slu[lu[i - 1] - p]));
      } else {
        long long p = lu[i - 1];
        printf("%I64d ",
               2 * (i * p - slu[p]) + i +
                   2 * (srd[rd[i + 1]] - srd[rd[i + 1] - p - 1] - (p + 1) * i));
      }
    }
  }
  return 0;
}
