#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
template <int MAXN>
struct SegmentTree {
  vector<long long int> arr, tree;
  SegmentTree() {
    arr.resize(MAXN);
    tree.resize(4 * MAXN);
  }
  void buildTree(int i = 0, int l = 0, int r = MAXN - 1) {
    if (l > r) {
      return;
    }
    if (l == r) {
      tree[i] = arr[l];
      return;
    }
    int mid = (l + r) >> 1;
    buildTree(2 * i + 1, l, mid);
    buildTree(2 * i + 2, mid + 1, r);
    tree[i] = tree[2 * i + 1] + tree[2 * i + 2];
  }
  long long int query(int lq, int rq, int i = 0, int l = 0, int r = MAXN - 1) {
    if (r < lq || rq < l || r < l) {
      return 0;
    }
    if (l >= lq && r <= rq) {
      return tree[i];
    }
    int mid = (l + r) >> 1;
    long long int q1 = query(lq, rq, 2 * i + 1, l, mid);
    long long int q2 = query(lq, rq, 2 * i + 2, mid + 1, r);
    return q1 + q2;
  }
  int kthelm_in_range(int &k, int lq = 0, int rq = MAXN - 1, int i = 0,
                      int l = 0, int r = MAXN - 1) {
    if (r < lq || rq < l || r < l || k <= 0 || rq < lq) {
      return -1;
    }
    if (l >= lq && r <= rq) {
      if (tree[i] < k) {
        k -= tree[i];
        return -1;
      }
      if (l == r) {
        k = 0;
        return l;
      }
      int mid = (l + r) >> 1;
      if (tree[2 * i + 1] >= k) {
        return kthelm_in_range(k, lq, rq, 2 * i + 1, l, mid);
      } else {
        k -= tree[2 * i + 1];
        return kthelm_in_range(k, lq, rq, 2 * i + 2, mid + 1, r);
      }
    }
    int mid = (l + r) >> 1;
    int q1 = kthelm_in_range(k, lq, rq, 2 * i + 1, l, mid);
    int q2 = kthelm_in_range(k, lq, rq, 2 * i + 2, mid + 1, r);
    return max(q1, q2);
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  SegmentTree<N> sum0, sum1, count0, count1;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'U') {
      count1.arr[i] = 1;
      sum1.arr[i] += i;
    } else {
      count0.arr[i] = 1;
      sum0.arr[i] += i;
    }
  }
  sum0.buildTree(), sum1.buildTree(), count0.buildTree(), count1.buildTree();
  for (int i = 0; i < n; i++) {
    int l = count1.query(0, i - 1), r = count0.query(i + 1, n - 1);
    if (s[i] == 'U') {
      if (r == 0) {
        cout << n - i << " ";
        continue;
      }
      if (r <= l) {
        int x = l - min(l, r) + 1;
        int li = count1.kthelm_in_range(x, 0, i - 1);
        long long int ans =
            abs(1LL * i * min(l, r) - sum0.query(i + 1, n - 1)) +
            abs(1LL * i * min(l, r) - sum1.query(li, i - 1));
        ans *= 2;
        ans += n - i;
        cout << ans << ' ';
      } else {
        int x = min(l, r) + 1;
        int ri = count0.kthelm_in_range(x, i + 1, n - 1);
        long long int ans =
            abs(1LL * i * (min(l, r) + 1) - sum0.query(i + 1, ri)) +
            abs(1LL * i * min(l, r) - sum1.query(0, i - 1));
        ans *= 2;
        ans += i + 1;
        cout << ans << ' ';
      }
    } else {
      if (l == 0) {
        cout << i + 1 << ' ';
        continue;
      }
      if (l <= r) {
        int x = min(l, r);
        int ri = count0.kthelm_in_range(x, i + 1, n - 1);
        long long int ans = abs(1LL * i * min(l, r) - sum0.query(i + 1, ri)) +
                            abs(1LL * i * min(l, r) - sum1.query(0, i - 1));
        ans *= 2;
        ans += i + 1;
        cout << ans << ' ';
      } else {
        int x = l - min(l, r);
        int li = count1.kthelm_in_range(x, 0, i - 1);
        long long int ans =
            abs(1LL * i * (min(l, r) + 1) - sum1.query(li, i - 1)) +
            abs(1LL * i * min(l, r) - sum0.query(i + 1, n - 1));
        ans *= 2;
        ans += n - i;
        cout << ans << ' ';
      }
    }
  }
  return 0;
}
