The solution is to hane at ; Black has to play
in order to make two eye shapes; the throw-in at
then starts the ko. This is a two-stage ko that is favourable for Black - White needs three moves (
, a and connect) to resolve it.
(Note on ko rules: In such a throw-in ko, Black can play immediately because it doesn't repeat a past position. White needs to play a ko threat before recapturing at
.)
If White plays on the top first, Black will just hane and make two eyes (White can't play at a because Black will immediately capture).