n = int(input())
for i in range(n):
if i % 2 == 1:
print(((str(i+1) + ' ')*5)[:-1])
else:
print('1 1 1 1')
n = int(input())
for i in range(n):
if i % 2 == 1:
print(((str(i+1) + ' ')*5)[:-1])
else:
print('1 1 1 1')