# -*- coding: utf-8 -*-
"""
Created on Sat May 28 19:17:42 2016

@author: AtoZ
"""
N,M = raw_input().split()
N,M = int(N),int(M)
while(1):
    
i0 = 0
while(i0<2**(M*N)):
    bit = [0]*M*N
    t_bit = bin(i0)
    lt_bit = len(t_bit)
    for j0 in range(lt_bit-2):
        bit[j0] = int(t_bit[j0+2])
    i0 +=1
    print bit
    
"""
N,M = raw_input().split()
N,M = int(N),int(M)
L0 = [] 
L = []
time = 0
def change(h,l):
    global time
    time += 1
    if h == N-1:
        pass
    else:
        L[h*M+l] = not L[h*M+l] 
        L[(h+1)*M+l] = not L[(h+1)*M+l]
        if l != 0:
            L[(h+1)*M+l-1] = not L[(h+1)*M+l-1]
        if l != M-1:
            L[(h+1)*M+l+1] = not L[(h+1)*M+l+1]
        if h != N-2:
            L[(h+2)*M+l] = not L[(h+2)*M+l]
        
while(1):
    try:
        temp = raw_input()
        L0.append(temp.split())
    except:
        break
        
for i in range(N):
    for j in range(M):
        L.append(int(L0[i][j]))
LL = [1]*N*M
j = 0
while(j<N):
    for i in range(M):
        ii = i+j*M
        if L[ii]==0:
            change(j,i)
    j += 1
if L==LL:
    print time
else:
    print "no solution"
"""