AA 125 then 7L 789 at O'Hare
Madrid → Chicago → Baku
Timetable, Chicago time
15:05AA 125 from Madrid at the gate
10:007L 789 to Baku leaves the gate
18 h 55 apart on the timetable, overnight
7L 789 leaves 18 h 55 after AA 125 arrives on the timetable: more than half a day, so not a connection we count.