St Mirren and Dunfermline took up the final two spots in the Scottish League Cup second round after the Buddies beat Partick Thistle 2-0 in Paisley.
Jamie McGrath's penalty and Joe Shaughnessy's strike ensured the Group H winners were seeded in the draw.
Second-placed Dunfermline progressed as the one of the three best runners-up.
Hearts, already assured of a place in the next round, secured maximum points in Group A after Jamie Walker's solitary goal defeated Inverness.
The Highlanders had Michael Gardyne sent off late on for a challenge on substitute Walker.
Hearts will visit Celtic in the second round with St Mirren away to Livingston and Dunfermline visiting Rangers.