Connect matching numbers with paths.