A ray of light passes through four transparent media with refractive index n1