#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
const int inf = 1e8 + 5;
int val_between(int l, int r, vector<int> &pref_H) {
return pref_H[r] - pref_H[l - 1];
}
void update(int v, int vl, int vr, int pos, int val, vector<int> &segtree) {
if(vl == vr) {
segtree[v] = val;
} else {
int mid = (vl + vr) / 2;
if(pos <= mid) {
update(2 * v, vl, mid, pos, val, segtree);
} else {
update(2 * v + 1, mid + 1, vr, pos, val, segtree);
}
segtree[v] = min(segtree[2 * v], segtree[2 * v + 1]);
}
}
int query(int v, int vl, int vr, int ql, int qr, vector<int> &segtree) {
if(vl > qr || vr < ql) {
return inf;
}
if(vl == ql && vr == qr) {
return segtree[v];
}
int mid = (vl + vr) / 2;
return min(query(2 * v, vl, mid, ql, min(qr, mid), segtree),
query(2 * v + 1, mid + 1, vr, max(ql, mid + 1), qr, segtree));
}
vector<int> try_case(int n, string s) {
vector<int> pref_K(1 + n, 0);
vector<int> pref_H(1 + n, 0);
vector<int> pref_all(1 + n, 0);
for(int i = 1; i <= n; i++) {
pref_K[i] += pref_K[i - 1];
pref_H[i] += pref_H[i - 1];
pref_all[i] += pref_all[i - 1];
if(s[i] == 'H') {
pref_H[i]++;
pref_all[i]--;
} else {
pref_K[i]++;
pref_all[i]++;
}
}
int mini = INT_MAX, maxi = INT_MIN;
for(int i = 1; i <= n; i++) {
mini = min(mini, pref_all[i]);
maxi = max(maxi, pref_all[i]);
}
// pref[r + 1] - pref[i - 1] < 0
// pref[r + 1] < pref[i - 1]
// segtree: l=-(1e6+2), r=(1e6+2)
// range=2e6+5
// size=1+4*range=4*(2e6+5)
// optimization: l-r for min-max pref value?
int l = mini - 1;
int r = maxi + 1;
int range = r - l + 1;
int offset = -l + 1;
vector<int> segtree(1 + 4 * range, inf);
vector<int> result(1 + n, 0);
for(int i = n; i >= 1; i--) {
/*update(1, l + offset, r + offset, pref_all[i] + offset, i, segtree);
int cur_rp1 = query(1, l + offset, r + offset, l + offset, pref_all[i - 1] - 1 + offset, segtree);
if(cur_rp1 == inf) {
cur_rp1 = n + 1;
}
int cur_r = cur_rp1 - 1;
if(cur_r >= i) {
result[i] = val_between(i, cur_r, pref_H);
}*/
}
/*cout << s.substr(1, (int) s.size() - 1) << "\n";
for(int i = 1; i <= n; i++) {
cout << result[i] << " ";
}
cout << "\n";*/
return result;
}
void solve() {
int n;
cin >> n;
string s;
cin >> s;
s = " " + s;
string t = s;
for(int i = 1; i <= n; i++) {
if(t[i] == 'M') {
t[i] = 'H';
}
}
vector<int> ans(1 + n, 0);
int idx = 0;
do {
vector<int> cur = try_case(n, t);
for(int i = 1; i <= n; i++) {
ans[i] = max(ans[i], cur[i]);
}
idx++;
while(idx <= n && s[idx] != 'M') {
idx++;
}
if(idx <= n) {
t[idx] = 'K';
}
} while(idx <= n);
for(int i = 1; i <= n; i++) {
cout << ans[i] << " ";
}
cout << "\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}