pairs problem