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