calculate and print permutation distances