"""
You are given 2 matrices of any size N*N. Write a program to find the product of the two matrixes (use Strassen’s Matrix Multiplication).
"""
size = int(input())
a = []
b = []
c = []
for i in range(size):
    a.append([int(y) for y in input().split()])
    
for i in range(size):
    b.append([int(x) for x in input().split()])
    
m1 = (a[0][0] + a[1][1]) * (b[0][0] + b[1][1])
m2 = (a[1][0] + a[1][1]) * (b[0][0])
m3 = a[0][0] * (b[0][1] - b[1][1])
m4 = a[1][1] * (b[1][0] - b[0][0])
m5 = b[1][1] * (a[0][0] + a[0][1])
m6 = (a[1][0] - a[0][0]) * (b[0][0] + b[0][1])
m7 = (a[0][1] - a[1][1]) * (b[1][0] + b[1][1])

c0 = m1 + m4 - m5 + m7
c1 = m3 + m5
c2 = m2 + m4
c3 = m1 - m2 + m3 + m6

c.append([c0, c1])
c.append([c2, c3])
print(c)