PQRS and QRTU are two faces of a cube with PQ = 12.

A beam of light emanates from vertex P and reflects off face QRTU at point X, which is 7 units from QU and 5 units from QR. The beam continues to be reflected off the faces of the cube.

The length of the light path from the time it leaves point P until it next reaches a vertex of the cube is given by A√B, where A and B are integers and B is not divisible by the square of any
prime.

Find A and B.