# returns idx such that x[idx] can be increased
# and -1, if increasing is impossible
def find(x, N, K):
res = N - 1
while res >= 0 and x[res] == K:
res -= 1
return res
# increase sequence
def next(x, pos):
x[pos] += 1
for k in range(pos + 1, len(x)):
x[k] = 1
N = int(input())
K = int(input())
x = [1] * N
print(x)
pos = find(x, N, K)
while pos >= 0:
next(x, pos)
print(x)
pos = find(x, N, K)