#include <bits/stdc++.h>
const long long N = 1000010;
using namespace std;
long long ans[N];
char s[N];
int b[N], d[N];
int main() {
  long long n, i, q = 0;
  long long l = 0, r = 0, j;
  long long l_d = 0, r_d = 0;
  long long answer = 0;
  memset(ans, -1, sizeof(ans));
  scanf("%lld", &n);
  scanf("%s", s);
  j = n - 1;
  q = 0;
  for (i = n - 1; i >= 0; i--) {
    j = min(j, i - 1);
    if (s[i] == 'D') {
      while (l < r && b[l] > i) {
        answer -= 2 * (i - b[l++]);
      }
      while (j >= 0 && r - l < q + 1) {
        if (s[j] == 'U') {
          b[r++] = j;
          answer += 2 * (i - j);
        }
        j--;
      }
      if (r - l < q + 1) break;
      ans[i] = answer + (n - i);
      d[r_d++] = i;
      q++;
    }
    answer += q * 2;
    answer -= (r - l) * 2;
  }
  for (; i >= 0; i--) {
    while (l < r && b[l] > i) {
      answer -= 2 * (i - b[l++]);
    }
    while (r - l < r_d - l_d) {
      if (r_d != l_d) answer -= 2 * (d[l_d] - i);
      l_d++;
    }
    if (s[i] == 'D') {
      d[r_d++] = i;
      ans[i] = answer + i + 1;
    }
    answer += (r_d - l_d) * 2;
    answer -= (r - l) * 2;
  }
  for (i = 0; i < n / 2; i++) swap(s[i], s[n - 1 - i]);
  for (i = 0; i < n; i++)
    if (s[i] == 'D')
      s[i] = 'U';
    else
      s[i] = 'D';
  l = 0;
  r = 0;
  l_d = 0;
  r_d = 0;
  j = n - 1;
  q = 0;
  answer = 0;
  for (i = n - 1; i >= 0; i--) {
    j = min(j, i - 1);
    if (s[i] == 'D') {
      while (l < r && b[l] > i) {
        answer -= 2 * (i - b[l++]);
      }
      while (j >= 0 && r - l < q + 1) {
        if (s[j] == 'U') {
          b[r++] = j;
          answer += 2 * (i - j);
        }
        j--;
      }
      if (r - l < q + 1) break;
      ans[n - i - 1] = answer + (n - i);
      d[r_d++] = i;
      q++;
    }
    answer += q * 2;
    answer -= (r - l) * 2;
  }
  for (; i >= 0; i--) {
    while (l < r && b[l] > i) {
      answer -= 2 * (i - b[l++]);
    }
    while (r - l < r_d - l_d) {
      if (r_d != l_d) answer -= 2 * (d[l_d] - i);
      l_d++;
    }
    if (s[i] == 'D') {
      d[r_d++] = i;
      ans[n - i - 1] = answer + i + 1;
    }
    answer += (r_d - l_d) * 2;
    answer -= (r - l) * 2;
  }
  for (i = 0; i < n; i++) printf("%lld ", ans[i]);
  return 0;
}
