import numpy as np
a,b=map(int,input().split())
c,d=map(int,input().split())
A=np.array([[a,b],[c,d]])
A=A@A@A
A.tolist()
print(*A[0])
print(*A[1])