repeated permutation by rolf

b,w=map(int,raw_input().split())
for i in range(b**w):r="";exec'r=`i%b+1`+" "+r;i/=b;'*w;print r[:-1]

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page