Ex. 147. In a convex quadrilateral, the point of intersection of the diagonals divides each of them in the ratio $1: 2$. The quadrilateral formed by sequentially connecting the midpoints of the sides is a square with a side of 3. Find the perimeter of the original quadrilateral.
Ex. 147. $4 \sqrt{5}+6 \sqrt{2}$.