When you xor two equal values, they cancel out. This allows to reveal the non-repeating pair.
XOR(aabbccddeeffgh) = XOR(gh) = ...1...
Knowing any bit on which g and h differ allows to set g and h aside in two subsets:
...0... => XOR(aabbcceeg) = g
...1... => XOR(ddffh) = h