What kind of engine are you working on?
Just guessing I'd say to take one of the heads and stand it up on one end, then start sticking your bolts through the holes. If you've got them in the right hole there should only be threads showing looking at the head from the side that bolts to the block. Repeat for other side.
You might also find an engine assembly manual that shows an exploded view with bolts lengths and which hole to stick em in.