accounts for queries for trains with stops between midnight and 3am