import numpy as np a = list(map(int, input().split())) a += list(map(int, input().split())) p = np.array(a).reshape((2, 2)) res = np.dot(p, p) res = np.dot(res, p) print(p[0][0], p[1][0]) print(p[0][1], p[1][1])