N, M = map(int, input().split()) ans = [[-1]*2**M for _ in range(2**N)] cnt = 0 for i in range(2**N): for j in range(2**M): ans[i][j] = cnt cnt += 1 for a in ans: print(*a)