m,k = gets.chomp.split.map(&:to_i)
  
 
if k == 0
  for i in 0..(m-1)
    str += i + " " + i + " "
  end
else
  for i in 0..(m-1)
    if i != k
      str += i + " "
    end
  end
  str += k + " "
  for i in 0..(m-1)
    if i != k
      str += (m-1-i) + " "
    end
  end
  str += k
end
print str