import numpy a,b=map(int,input().split()) c,d=map(int,input().split()) M=numpy.matrix([[a,b],[c,d]]) for v in (M*M*M).tolist():print(*v)