n, k = map(int, input().split()) ans = [1, 4, 2, 3] * (n // 4) + [1, 4, 2, 3][:n % 4] ans[-k:] = [ans[- k - 1]] * k print(*ans)