
while true
	i = gets.chomp.to_i(10)
	break if i == 0
	str = gets.chomp

	i.times do
		result = ""
		while str =~ /^(?=(.))(\1+)(.*)$/
			result << "#{$2.length}#{$1}"
			str = $3
		end
		str = result
	end

	puts str

end