def mul(A, B): C = [[0,0], [0,0]] for i in [0, 1]: for j in [0, 1]: for k in [0, 1]: C[i][j] += A[i][k] * B[k][j] return C #================================================== def solve(): M11, M12 = map(int, input().split()) M21, M22 = map(int, input().split()) M = [[M11, M12], [M21, M22]] [[N11, N12], [N21, N22]] = mul(M, mul(M, M)) print(N11, N12) print(N21, N22) #================================================== solve()