b = int(input('by:'))
s = list(input())
for i in range(len(s)):
    a = ord(s[i])
    for j in range(b-1,-1,-1):
        if a >= 2**j:
            print(1,end = '')
            a -= 2**j
        else:
            print(0,end = '')

a = int(input('by:'))
s = list(input())
l = [0]*a
for i in range(len(s)//a):
    for j in range(a):
        l[j] = int(s[0])
        s.remove(s[0])
    n = 0
    for j in range(a):
        n += l[j]*2**(a-1-j)
    print(chr(n),end = '')