def main(): m11,m12=map(int,input().split()) m21,m22=map(int,input().split()) m = [[m11,m12],[m21,m22]] m2 = mult(m,m) m3 = mult(m2,m) for r in m3: print(" ".join(map(str,r))) def mult(a,b): return [[sum(a[i][j]*b[j][k] for j in range(2)) for k in range(2)] for i in range(2)] if __name__ == "__main__": main()