In the right parallelopiped $ABCDA^{\prime}B^{\prime}C^{\prime}D^{\prime}$, with $AB=12\sqrt{3}$ cm and $AA^{\prime}=18$ cm, we consider the points $P\in AA^{\prime}$ and $N\in A^{\prime}B^{\prime}$ such that $A^{\prime}N=3B^{\prime}N$. Determine the length of the line segment $AP$ such that for any position of the point $M\in BC$, the triangle $MNP$ is right angled at $N$.