n,k=gets.split.map(&:to_i) ans=[0] x = 0 (n-k).times{|i| if i == 0 next end if i % 2 == 0 x -= 1 else x += 2 end ans.push(x) } ans.push([ans[-1]] * k) puts ans.join(' ')