Max length chain of pairs