import itertools;x,y=map(int,raw_input().split(' ')) for z in itertools.product(range(1,x+1),repeat=y):print ' '.join(map(str,z))
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page