#include <bits/stdc++.h>
using namespace std;
const int N = 3000000;
int n;
string s;
vector<int> v1, v2;
long long sum1, sum2, ans[N];
void solve(string &s, bool f) {
  v1.clear();
  v2.clear();
  for (int i = n; i > 0; i--)
    if (s[i] == 'D') v2.push_back(i);
  sum1 = 0;
  sum2 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'U') {
      int j = i;
      if (f) j = n - 1 - j;
      if (v2.size() <= v1.size()) {
        ans[j] = 2 * sum2 - 2 * sum1 + n - i;
      } else {
        ans[j] +=
            2 * sum2 - 2 * sum1 + 2 * v2[v2.size() - v1.size() - 1] + 1 - i;
      }
      v1.push_back(i);
      if (v1.size() <= v2.size()) {
        sum1 += i;
        sum2 += v2[v2.size() - v1.size()];
      } else {
        sum1 += i;
        sum1 -= v1[v1.size() - 1 - v2.size()];
      }
    } else {
      if (i == 0) continue;
      v2.pop_back();
      if (v1.size() <= v2.size()) {
        if (v1.size() > 0) {
          sum2 -= i;
          sum2 += v2[v2.size() - v1.size()];
        }
      } else {
        sum2 -= i;
        sum1 -= v1[v1.size() - 1 - v2.size()];
      }
    }
  }
}
int main() {
  cin >> n;
  cin >> s;
  solve(s, 0);
  reverse(s.begin(), s.end());
  for (int i = 0; i < s.length(); i++)
    if (s[i] == 'U')
      s[i] = 'D';
    else
      s[i] = 'U';
  solve(s, 1);
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
