A=[] B=[] C=[] for i in range(2): a,b=map(int,input().split()) A.append([a,b]) B.append([a,b]) C.append([a,b]) D=[[0]*2 for i in range(2)] for i in range(2): for j in range(2): for k in range(2): D[i][j]+=A[i][k]*A[k][j] result=[[0]*2 for i in range(2)] for i in range(2): for j in range(2): for k in range(2): result[i][j]+=A[i][k]*D[k][j] for i in range(2): print(*result[i])