s,l=map(str,input().split())
k=""
for i in range(0,len(s)):
	for j in range(i+1,len(s)+1):
		if len(s[i:j])==int(l):
			k=k+s[i:j]+" "
print(k.strip())
#subset

9ca8c276ef2eb5df201b36ffbbdd0085d7e8ad0f
<mask token>

<mask token>
for i in range(0, len(s)):
    for j in range(i + 1, len(s) + 1):
        if len(s[i:j]) == int(l):
            k = k + s[i:j] + ' '
print(k.strip())

s, l = map(str, input().split())
k = ''
for i in range(0, len(s)):
    for j in range(i + 1, len(s) + 1):
        if len(s[i:j]) == int(l):
            k = k + s[i:j] + ' '
print(k.strip())

s,l=map(str,input().split())
k=""
for i in range(0,len(s)):
	for j in range(i+1,len(s)+1):
		if len(s[i:j])==int(l):
			k=k+s[i:j]+" "
print(k.strip())
#subset
