Both Onodi and Haller cells are anatomical variants of the ethmoid air cells, and the question asks which neighbouring structure each one threatens.
Start with the Onodi cell. It is the most posterior ethmoid cell that balloons backward and upward into the sphenoid area, wrapping near the optic nerve. Because of this, surgeons must be cautious of optic nerve injury when operating in this region, so the Onodi cell is linked to the optic nerve.
Now the Haller cell, also called the infraorbital ethmoid cell. It grows downward into the floor of the orbit near the maxillary sinus opening, so it is tied to the orbital floor and can obstruct maxillary sinus drainage.
Pairing them in the order asked gives optic nerve for the Onodi cell and orbital floor for the Haller cell.
\[\boxed{\text{Optic nerve and orbital floor}}\]