M=[list(map(int,input().split())) for _ in range(2)] N=[[0,0] for _ in range(2)] N[0][0]=M[0][0] N[0][1]=M[0][1] N[1][0]=M[1][0] N[1][1]=M[1][1] N[0][0]=N[0][0]*M[0][0]+N[0][1]*M[1][0] N[0][1]=N[0][0]*M[0][1]+N[0][1]*M[1][1] N[1][0]=N[1][0]*M[0][0]+N[1][1]*M[1][0] N[1][1]=N[1][0]*M[0][1]+N[1][1]*M[1][1] N[0][0]=N[0][0]*M[0][0]+N[0][1]*M[1][0] N[0][1]=N[0][0]*M[0][1]+N[0][1]*M[1][1] N[1][0]=N[1][0]*M[0][0]+N[1][1]*M[1][0] N[1][1]=N[1][0]*M[0][1]+N[1][1]*M[1][1] print(*N[0]) print(*N[1])