n, m = map(int,input().split())
k = [list(map(int,input().split())) for i in range(m)]
p = list(map(int,input().split()))

for i in range(2**n):
  i_2 = str(bin(i))[2:]
  i_bit = i_2.zfill(n)
  print(i_bit)
  