give permutation a_1 a_2 dots a_n integer 1 n threshold k 0 leq k leq n compute sequence b_1 b_2 dots b_n follow for 1 leq leq n increase order let x a_i if x leq k set b_x element a_j 1 leq j a_j k if element a_j exist set b_x n1 if x k set b_x element a_j 1 leq j a_j leq k if element a_j exist set b_x 0 unfortunately sequence b_1 b_2 dots b_n completely computed permutation a_1 a_2 dots a_n threshold k discard now sequence b_1 b_2 dot b_n your task find possible permutation a_1 a_2 dots a_n threshold k produce sequence b_1 b_2 dots b_n it guarantee exist pair permutation a_1 a_2 dots a_n threshold k produce sequence b_1 b_2 dots b_na permutation integer 1 n sequence length n contain integer 1 n exactly