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