# importing necessary library
import numpy as np

# function to generate binary sequence
def binary(n):
    
    # initialising the pattern for 1 digit
    
    # "dvikau glau"
    a = np.matrix('0;1')

    # "misrau ca"
    for i in range(1,n):
        a = build(a)
    
    print(a)

#function to implement - "pruthaglaa mis'raah"
def build(a):
    
    # mixing zeros/laghus
    m1 = np.hstack((a,np.zeros((a.shape[0],1))))
    # mixing ones/gurus
    m2 = np.hstack((a,np.ones((a.shape[0],1))))
    
    #joins both vertically and returns for further mixing
    return np.vstack((m1,m2))

#taking input for number of digits from the user
n = input("Enter number of digits = ")

# calling the function to generate binary patterns
binary(int(n))
