while True:
try:
r=int(input())
m1=[]
m2=[]
l1=input().split()
l2=input().split()
for i in range(r):
m1.append(l1[i*r:i*r+r])
m2.append(l2[i*r:i*r+r])
print(m1,m2)
except:
break
d2hpbGUgVHJ1ZToKCXRyeToKCQlyPWludChpbnB1dCgpKQoJCW0xPVtdCgkJbTI9W10KCQlsMT1pbnB1dCgpLnNwbGl0KCkKCQlsMj1pbnB1dCgpLnNwbGl0KCkKCQkKCQlmb3IgaSBpbiByYW5nZShyKToKCQkJbTEuYXBwZW5kKGwxW2kqcjppKnIrcl0pCgkJCW0yLmFwcGVuZChsMltpKnI6aSpyK3JdKQoJCQkKCQkKCQlwcmludChtMSxtMikKCQoJZXhjZXB0OgoJCWJyZWFrCgoJ