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,n):

	for j in range(n):

		aa = ""

		s = a[0]

		c = 1

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

			if a[i] == s:

				c += 1

			else:

				aa += str(c) + s

				s = a[i]

				c = 1

		a = aa + str(c) + s

	return a

	

while 1:

	n = eval(input())

	if n == 0: break

	a = input()

	print(f(a,n))
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, n):
    for j in range(n):
        aa = ""
        s = a[0]
        c = 1
        for i in range(1, len(a)):
            if a[i] == s:
                c += 1
            else:
                aa += str(c) + s
                s = a[i]
                c = 1
        a = aa + str(c) + s
    return a


while 1:
    n = eval(input())
    if n == 0:
        break
    a = input()
    print(f(a, n))

-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 +def f(a, n): +    for j in range(n): +        aa = "" +        s = a[0] +        c = 1 +        for i in range(1, len(a)): +            if a[i] == s: +                c += 1 +            else: +                aa += str(c) + s +                s = a[i] +                c = 1 +        a = aa + str(c) + s +    return a -    for i in range(n): -        a = f(a) -    print(a) +    print(f(a, n))