#include <bits/stdc++.h>
using namespace std;
const int iinf = 0x7fffffff;
const long long linf = ~(1LL << 63);
template <typename T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  if (a < b) return gcd(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long qpow(long long a, long long n, long long mod) {
  a %= mod;
  long long ans = 1LL;
  while (n) {
    if (n & 1) ans = (ans * a % mod);
    a = (a * a % mod);
    n >>= 1;
  }
  return ans;
}
inline long long rev(long long a, long long p) { return qpow(a, p - 2, p); }
inline int in() {
  int x;
  cin >> x;
  return x;
}
inline void tic() {}
inline void toc() {}
const int maxn = 1010000;
const int INF = 1e9;
char step[maxn];
long long ku[maxn], kd[maxn];
long long tr[maxn], tl[maxn];
long long posu[maxn], posd[maxn];
int main() {
  int n;
  ios::sync_with_stdio(0);
  cin >> n >> (step + 1);
  posu[0] = 0;
  posd[0] = n + 1;
  for (int i = 1; i < n + 1; i++) {
    tl[i] = tl[i - 1] + ku[i - 1] * 2 + 1;
    ku[i] = ku[i - 1] + int(step[i] == 'U');
    if (ku[i] == ku[i - 1])
      posu[ku[i]] = posu[ku[i - 1]];
    else
      posu[ku[i]] = i;
  }
  for (int i = n; i >= 1; i--) {
    tr[i] = tr[i + 1] + kd[i + 1] * 2 + 1;
    kd[i] = kd[i + 1] + int(step[i] == 'D');
    if (kd[i] == kd[i + 1])
      posd[kd[i]] = posd[kd[i + 1]];
    else
      posd[kd[i]] = i;
  }
  for (int i = 1; i < n + 1; i++) {
    if (ku[i] < kd[i] || (ku[i] == kd[i] && step[i] == 'U')) {
      long long ans = tl[i] + tr[i];
      int f = int(step[i] == 'D');
      long long delta = kd[i] - ku[i] - f;
      long long p = posd[delta];
      ans = ans - tr[p] - (p - i) - 2 * delta * (p - i);
      cout << ans << " ";
    } else {
      long long ans = tl[i] + tr[i];
      int f = int(step[i] == 'U');
      long long delta = ku[i] - kd[i] - f;
      long long p = posu[delta];
      ans = ans - tl[p] - (i - p) - 2 * delta * (i - p);
      cout << ans << " ";
    }
  }
  cout << endl;
  return 0;
}
