N,K=gets.split.map &:to_i begin loop{|i|p~-N%-~K-~K*i} rescue Errno::EPIPE => e end