n, h = map(int, input().split()) d = [] i = 0 while n%2**i == 0: d.append(2**i); i += 1 for v in d[:0:-1]: d.append(n//v) k = min(h, n//h) ans = [[]] for v in d: if v < n//k: for _ in range(v): ans[0].append(v) else: for _ in range(n//k//v): ans.append([v]*(n//k)) if k < h: ans = zip(*ans) for s in ans: print(*s)