import sys import numpy as np a, b = map(int, input().split()) c, d = map(int, input().split()) M = np.matrix([[a, b], [c, d]]) np.savetxt(sys.stdout, M * M * M, fmt='%i')