reorder files: math problem (permutations which change all slots)