#include <bits/stdc++.h>
using namespace std;
char pho[1000500];
long long l[1000500], r[1000500], ll[1000500], rr[1000500];
int main() {
  int n;
  scanf("%d%s", &n, pho + 1);
  for (int i = 1; i <= n; i++) {
    if (pho[i] == 'U') {
      r[i] = r[i - 1] + 1;
      ll[i] = ll[i - 1];
    } else {
      r[i] = r[i - 1];
      ll[i] = ll[i - 1] + i;
    }
  }
  for (int i = n; i >= 1; i--) {
    if (pho[i] == 'D') {
      l[i] = l[i + 1] + 1;
      rr[i] = rr[i + 1];
    } else {
      l[i] = l[i + 1];
      rr[i] = rr[i + 1] + n - i;
    }
  }
  for (int i = 1; i <= n; i++) {
    long long ans = 0;
    if (pho[i] == 'U') {
      long long al = l[i + 1], ar = r[i - 1];
      if (al >= ar + 1) {
        ans += i;
        int s = i + 1, e = n;
        while (s <= e) {
          int m = (s + e) >> 1;
          if (l[i + 1] - l[m + 1] >= ar + 1)
            e = m - 1;
          else
            s = m + 1;
        }
        if (s <= n) {
          ans += (ll[s] - ll[i]) * 2;
          ans -= (ar + 1) * i * 2;
          ans += (rr[1] - rr[i]) * 2;
          ans -= ar * (n - i) * 2;
        }
      } else {
        ans += n - i + 1;
        if (al) {
          int s = 1, e = i - 1;
          while (s <= e) {
            int m = (s + e) >> 1;
            if (r[i - 1] - r[m - 1] >= al)
              s = m + 1;
            else
              e = m - 1;
          }
          if (e) {
            ans += (ll[n] - ll[i]) * 2;
            ans -= al * i * 2;
            ans += (rr[e] - rr[i]) * 2;
            ans -= al * (n - i) * 2;
          }
        }
      }
    } else {
      long long al = l[i + 1], ar = r[i - 1];
      if (ar >= al + 1) {
        ans += n - i + 1;
        int s = 1, e = i - 1;
        while (s <= e) {
          int m = (s + e) >> 1;
          if (r[i - 1] - r[m - 1] >= al + 1)
            s = m + 1;
          else
            e = m - 1;
        }
        if (e) {
          ans += (ll[n] - ll[i]) * 2;
          ans -= (al)*i * 2;
          ans += (rr[e] - rr[i]) * 2;
          ans -= (al + 1) * (n - i) * 2;
        }
      } else {
        ans += i;
        if (ar) {
          int s = i + 1, e = n;
          while (s <= e) {
            int m = (s + e) >> 1;
            if (l[i + 1] - l[m + 1] >= ar)
              e = m - 1;
            else
              s = m + 1;
          }
          if (s <= n) {
            ans += (ll[s] - ll[i]) * 2;
            ans -= ar * i * 2;
            ans += (rr[1] - rr[i]) * 2;
            ans -= ar * (n - i) * 2;
          }
        }
      }
    }
    printf("%lld ", ans);
  }
}
