save pairwise dist