n,m=map(int,input().split()) count=0 for i in range(2**n): ans=[] for j in range(2**m): ans.append(count) count+=1 print(*ans)