Pair class replacement