loop do
    n = gets.to_i
    break if n == 0
    a = [0] * n
    f = 0
    gets.chomp.each_char.with_index do |c, i|
        if c == ?M
            a[i % n] += 1
        elsif c == ?L
            a[i % n] += 1 + f
            f = 0
        else
            f += 1 + a[i % n]
            a[i % n] = 0
        end
    end
    puts (a.sort + [f]) * ' '
end
