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