A characterization of complementing sets of pairs of integers