import itertools N, K = map(int, input().split()) c = itertools.cycle([1, 4, 2, 3]) ans = [next(c) for _ in range(N - K)] ans += [(5 if ans[-1] > ans[-2] else 0)] * K print(ans)