x=input().split() for i in __import__("itertools").product(*[range(1,int(x[0])+1)]*int(x[1])):print(*i)