a,b=gets.split(' ') puts Array(1..a.to_i).combination(b.to_i).to_a.map{|a|a.join' '}