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(*res[0]) print(*res[1])