AY 1012 then AY 1251 at Helsinki
Tallinn → Helsinki → Budapest
Timetable, Helsinki time
08:40AY 1012 from Tallinn at the gate
07:15AY 1251 to Budapest leaves the gate
22 h 35 apart on the timetable, overnight
AY 1251 leaves 22 h 35 after AY 1012 arrives on the timetable: more than half a day, so not a connection we count.