The inner parallelogram in the figure is formed from the midsegments of the four triangles created by the outer parallelogram’s diagonals. The lengths of the smaller and larger midsegments are as indicated. If the perimeter of the outer parallelogram is 40, find the value of x.