subsequences and permutations