W4 3173 then FR 3876 at Madrid
Bucharest → Madrid → Tangier
Timetable, Madrid time
17:50W4 3173 from Bucharest at the gate
14:05FR 3876 to Tangier leaves the gate
20 h 15 apart on the timetable, overnight
FR 3876 leaves 20 h 15 after W4 3173 arrives on the timetable: more than half a day, so not a connection we count.