#include <bits/stdc++.h>
using namespace std;
int sum[2][1000005];
long long dp[2][1000005];
char s[1000005];
vector<int> v[2];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", s + 1);
  v[0].push_back(0);
  v[1].push_back(1);
  for (int i = 1; i <= n; i++) {
    if (s[i] == 'U') {
      sum[0][i]++;
      dp[0][i] += i;
      v[0].push_back(i);
    } else {
      sum[1][i]++;
      dp[1][i] += i;
      v[1].push_back(i);
    }
    for (int j = 0; j < 2; j++) {
      sum[j][i] += sum[j][i - 1];
      dp[j][i] += dp[j][i - 1];
    }
  }
  for (int i = 1; i <= n; i++) {
    if (s[i] == 'U') {
      int l = sum[0][i - 1];
      int r = sum[1][n] - sum[1][i];
      if (l == 0 && r == 0) {
        printf("%d ", n - i + 1);
      } else if (l == 0) {
        int s = sum[1][i];
        int idx = v[1][s + 1];
        printf("%d ", idx - i + idx);
      } else if (r > l) {
        int s1 = sum[1][i], s0 = sum[0][i];
        int idx1 = v[1][s1 + l];
        int idx0 = v[0][s0 - 1];
        long long res = (dp[1][idx1] - dp[1][i] - dp[0][idx0]) * 2;
        idx1 = v[1][s1 + l + 1];
        res += idx1 - i;
        res += idx1;
        printf("%lld ", res);
      } else {
        int s1 = sum[1][i], s0 = sum[0][i];
        int idx1 = v[1][s1 + r];
        int idx0 = v[0][s0 - 1];
        int idx00 = v[0][s0 - 1 - r];
        long long res =
            (dp[1][idx1] - dp[1][i] - (dp[0][idx0] - dp[0][idx00])) * 2;
        res += n - i + 1;
        printf("%lld ", res);
      }
    } else {
      int l = sum[0][i - 1];
      int r = sum[1][n] - sum[1][i];
      if (l == 0 && r == 0) {
        printf("%d ", i);
      } else if (r == 0) {
        int s = sum[0][i];
        int idx = v[0][s];
        printf("%d ", i - idx + n - idx + 1);
      } else if (l > r) {
        int s1 = sum[1][i], s0 = sum[0][i];
        int idx1 = v[1][s1 + r];
        int idx0 = v[0][s0];
        int idx00 = v[0][s0 - r];
        long long res =
            (dp[1][idx1] - dp[1][i] - (dp[0][idx0] - dp[0][idx00])) * 2;
        idx0 = v[0][s0 - r];
        res += i - idx0;
        res += n - idx0 + 1;
        printf("%lld ", res);
      } else {
        int s1 = sum[1][i], s0 = sum[0][i];
        int idx1 = v[1][s1 + l];
        int idx0 = v[0][s0];
        long long res = (dp[1][idx1] - dp[1][i] - dp[0][idx0]) * 2;
        idx0 = v[0][s0 - r];
        res += i;
        printf("%lld ", res);
      }
    }
  }
}
