#include <bits/stdc++.h>
using namespace std;
const int iinf = 1e9 + 7;
const long long linf = 1ll << 60;
const double dinf = 1e10;
template <typename T>
inline void scf(T &x) {
  bool f = 0;
  x = 0;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  if (c == '-') {
    f = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (f) x = -x;
  return;
}
template <typename T1, typename T2>
void scf(T1 &x, T2 &y) {
  scf(x);
  return scf(y);
}
template <typename T1, typename T2, typename T3>
void scf(T1 &x, T2 &y, T3 &z) {
  scf(x);
  scf(y);
  return scf(z);
}
const int N = 1e6 + 100;
int n;
char str[N];
int cntu[N], cntd[N];
struct fenwick_tree {
  long long num[N];
  inline int lowbit(int i) { return i & (-i); }
  inline void modify(int i, long long x) {
    for (; i <= n; i += lowbit(i)) num[i] += x;
    return;
  }
  inline long long query(int i) {
    long long ret = 0;
    for (; i; i ^= lowbit(i)) ret += num[i];
    return ret;
  }
} su, sd;
inline int findu(int i, int t) {
  int lft = cntu[i - 1] - t + 1;
  int lb = 0, rb = i - 1;
  while (lb <= rb) {
    int mid = lb + rb >> 1;
    if (cntu[mid] < lft)
      lb = mid + 1;
    else
      rb = mid - 1;
  }
  return lb;
}
inline int findd(int i, int t) {
  int lft = cntd[i + 1] - t + 1;
  int lb = i + 1, rb = n;
  while (lb <= rb) {
    int mid = lb + rb >> 1;
    if (cntd[mid] >= lft)
      lb = mid + 1;
    else
      rb = mid - 1;
  }
  return rb;
}
int main() {
  scf(n);
  scanf("%s", str + 1);
  for (int i = (1); i <= (n); i++) cntu[i] = cntu[i - 1] + (str[i] == 'U');
  for (int i = (n); i >= (1); i--) cntd[i] = cntd[i + 1] + (str[i] == 'D');
  for (int i = (1); i <= (n); i++)
    if (str[i] == 'U')
      su.modify(i, (long long)i);
    else
      sd.modify(i, (long long)i);
  for (int i = (1); i <= (n); i++) {
    int t = min(cntu[i - 1], cntd[i + 1]);
    int pos1 = findu(i, t), pos2 = findd(i, t);
    long long ans = t ? 2ll * (sd.query(pos2) - sd.query(i) - su.query(i - 1) +
                               su.query(pos1 - 1))
                      : 0;
    if (str[i] == 'U')
      ans -= (long long)i;
    else
      ans += (long long)i;
    if (str[i] == 'U') {
      if (cntd[i + 1] == t)
        ans += (long long)n + 1;
      else {
        int pos = findd(i, t + 1);
        ans += 2 * (long long)pos;
      }
    } else if (cntu[i - 1] > t) {
      int pos = findu(i, t + 1);
      ans += (long long)(n + 1) - (long long)pos * 2;
    }
    printf("%I64d ", ans);
  }
  return 0;
}
