def calc(a, b, c, d, e, f, g, h): x = a * e + b * g y = a * f + b * h z = c * e + d * g w = c * f + d * h return x, y, z, w a, b = map(int, input().split()) c, d = map(int, input().split()) e, f = map(int, input().split()) g, h = map(int, input().split()) x, y, z, w = calc(a, b, c, d, e, f, g, h) x, y, z, w = calc(x, y, z, w, x, y, z, w) print(x, y) print(z, w)