FR 5357 then A3 1777 at Madrid
Krakow → Madrid → Lisbon
Timetable, Madrid time
22:20FR 5357 from Krakow at the gate
18:00A3 1777 to Lisbon leaves the gate
19 h 40 apart on the timetable, overnight
A3 1777 leaves 19 h 40 after FR 5357 arrives on the timetable: more than half a day, so not a connection we count.