#include <bits/stdc++.h>
using namespace std;
char _;
const int maxN = 1000 * 1000 + 5;
const int mod = 1000 * 1000 * 1000 + 7;
int L[maxN], R[maxN];
int l[maxN], r[maxN];
int dir[maxN];
long long ans[maxN];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    L[i] = cnt;
    if (s[i] == 'U') cnt++;
  }
  cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    R[i] = cnt;
    if (s[i] == 'D') cnt++;
  }
  for (int i = 0; i < n; i++) {
    int mn = min(L[i], R[i]);
    int ll = mn, rr = mn;
    if (s[i] == 'U') {
      if (R[i] > mn) rr++;
    } else {
      if (L[i] > mn) ll++;
    }
    if (ll == rr)
      dir[i] = (s[i] == 'U');
    else {
      if (ll < rr)
        dir[i] = 0;
      else
        dir[i] = 1;
    }
    l[i] = ll;
    r[i] = rr;
    if (dir[i])
      ans[i] = (n - i);
    else
      ans[i] = i + 1;
  }
  long long res = 0;
  queue<int> q;
  for (int i = 0; i < n; i++) {
    while (q.size() > l[i]) {
      res -= q.front();
      q.pop();
    }
    ans[i] += 2 * ((1LL) * l[i] * i - res);
    if (s[i] == 'U') {
      res += i;
      q.push(i);
    }
  }
  while (q.size()) q.pop();
  res = 0;
  for (int i = n - 1; i >= 0; i--) {
    while (q.size() > r[i]) {
      res -= q.front();
      q.pop();
    }
    ans[i] += 2 * (res - (1LL) * r[i] * i);
    if (s[i] == 'D') {
      res += i;
      q.push(i);
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << ' ';
  cout << endl;
  return 0;
}
