SM 3109 then FR 394 at Madrid
Cairo → Madrid → Ibiza
Timetable, Madrid time
11:45SM 3109 from Cairo at the gate
06:25FR 394 to Ibiza leaves the gate
18 h 40 apart on the timetable, overnight
FR 394 leaves 18 h 40 after SM 3109 arrives on the timetable: more than half a day, so not a connection we count.