you give n pattern p_1 p_2 dot p_n m string s_1 s_2 dot s_m each pattern p_i consist k character lowercase latin letter wildcard character denote underscore all pattern pairwise distinct each string s_j consist k lowercase Latin lettersA string match pattern b 1 k b_i wildcard character b_ia_iYou ask rearrange pattern way pattern jth string match pmt_j you allow leave order pattern unchangedcan perform rearrangement if print valid order