$59 M$ is the midpoint of edge $B B^{\prime}$ of the cube $A B C D-A^{\prime} B^{\prime} C^{\prime} D^{\prime}$, and a moving point $P$ travels around the perimeter of square $A B C D$. Find the locus of the centroid $G$ of $\triangle P A M$.

As the point $P$ moves around the perimeter of the square $A B C D$, the centroid $G$ of $\triangle P A M$ will trace out a specific path.
59 Let the midpoint of $AB$ be $E$, the midpoint of $AD$ be $F$, and the midpoint of $AC$ be $O$. When $P$ moves around the square $ABCD$ for one cycle, the midpoint of $AP$ moves around the square $AEOF$ for one cycle. On $MA, ME, MO, MF$, take points $A_1, E_1, O_1, F_1$ respectively, such that $MA_1: MA = ME_1: ME = MO_1: MO = MF_1: MF = \frac{2}{3}$. Then the square $A_1E_1O_1F_1$ is the trajectory of the centroid $G$.