num=int(input("enter the num:"))
num1=int(input("enter the num1:"))
# a=[]
i=1
while i<=(num):
    j=1

    b=[]
    while j<=(num1):
        b.append(j)
        print(b,end=" ")
        print()
        j=j+1
    print()
    i=i+4  
