CA 866 then FR 5356 at Madrid
Havana → Madrid → Krakow
Timetable, Madrid time
15:30CA 866 from Havana at the gate
14:45FR 5356 to Krakow leaves the gate
23 h 15 apart on the timetable, overnight
FR 5356 leaves 23 h 15 after CA 866 arrives on the timetable: more than half a day, so not a connection we count.