Vertical angles share a vertex and have opposite rays for sides.
Rays AE and AB are opposite; rays AG and AC are opposite. These are the only pairs of opposite rays in the figure, so the vertical angles must be constructed from one of the rays of the first pair and one of the rays of the second pair. ∠EAG and ∠BAC are a pair of vertical angles.