2002 AIME I Problem 11

Let A B C D and B C F G be two faces of a cube with A B=12. A beam of light emanates from vertex A and reflects off face B C F G at point P, which is 7 units from \overline{B G} and 5 units from \overline{B C}. The beam continues to be reflected off the faces of the cube. The length of the light path from the time it leaves point A until it next reaches a vertex of the cube is given by m \sqrt{n}, where m and n are integers and n is not divisible by the square of any prime. Find m+n.