while 1:

	n=eval(input())

	if n==0:break

	a=input()

	for r in range(n):

		aa=""

		s=a[0]

		count=1

		for i in range(len(a)-1):

			if a[i]==a[i+1]:

				count+=1

			else:

				aa+=str(count)+s

				count=1

				s=a[i+1]

		aa+=str(count)+s

		a=aa

	print(a)
def f(a):

	ans = ""

	s = a[0]

	c = 1

	for i in range(1,len(a)):

		if a[i] == s:

			c += 1

		else:

			ans += str(c) + s

			s = a[i]

			c = 1

	ans += str(c) + s

	return ans

	

while 1:

	n = eval(input())

	if n == 0: break

	a = input()

	for i in range(n):

		a = f(a)

	print(a)
while 1:
    n = eval(input())
    if n == 0:
        break
    a = input()
    for r in range(n):
        aa = ""
        s = a[0]
        count = 1
        for i in range(len(a) - 1):
            if a[i] == a[i + 1]:
                count += 1
            else:
                aa += str(count) + s
                count = 1
                s = a[i + 1]
        aa += str(count) + s
        a = aa
    print(a)

def f(a):
    ans = ""
    s = a[0]
    c = 1
    for i in range(1, len(a)):
        if a[i] == s:
            c += 1
        else:
            ans += str(c) + s
            s = a[i]
            c = 1
    ans += str(c) + s
    return ans


while 1:
    n = eval(input())
    if n == 0:
        break
    a = input()
    for i in range(n):
        a = f(a)
    print(a)

+def f(a): +    ans = "" +    s = a[0] +    c = 1 +    for i in range(1, len(a)): +        if a[i] == s: +            c += 1 +        else: +            ans += str(c) + s +            s = a[i] +            c = 1 +    ans += str(c) + s +    return ans + + -    for r in range(n): -        aa = "" -        s = a[0] -        count = 1 -        for i in range(len(a) - 1): -            if a[i] == a[i + 1]: -                count += 1 -            else: -                aa += str(count) + s -                count = 1 -                s = a[i + 1] -        aa += str(count) + s -        a = aa +    for i in range(n): +        a = f(a)