def f(a, b): return [ a[0] * b[0] + a[1] * b[2], a[0] * b[1] + a[1] * b[3], a[2] * b[0] + a[3] * b[2], a[2] * b[1] + a[3] * b[3], ] a = [int(x) for x in input().split()] a.extend([int(x) for x in input().split()]) ans = f(a, f(a, a)) print(ans[0], ans[1]) print(ans[2], ans[3])