($n,$k)=<>=~/\d+/g;$v=$|++;print($v+=($n-$v-1)%($k+1),$/),$v=<>while$v<$n