A patient with a tumor in the right infratemporal fossa shows a significant shift of the mandible to the right when opening. Which nerve is involved?

Glossopharyngeal nerve IX.

Trigeminal nerve V.

Facial nerve VII.

Hypoglossal nerve XII