Consider a string \(s\) of length \(n\) that consists of lowercase Latin alphabetic characters. You are given an array \(A\) of size 26 showing the value for each alphabet. You must output the subsequence of size \(k\) whose sum of values is maximum.
If there are multiple subsequences available, then print the lexicographically smallest sequence.
String \(p\) is lexicographically smaller than string \(q\) if \(p\) is a prefix of \(q\) and is not equal to \(q\) or there exists \(i\), such that \(p_i < q_i\) and for all \(j < i\) it is satisfied that \(p_j = q_j\). For example, '\(abc\)' is lexicographically smaller than '\(abcd\)', '\(abd\)' is lexicographically smaller than '\(abec\)', and '\(afa\)' is not lexicographically smaller than '\(ab\)'.
Input format
- The first line contains an integer \(t\) representing the number of test cases.
- For each test case, you are given two integers \(n\) and \(k\), a string \(s\), and an array \(A\) of length 26.
Output format
Print a string for each test case.
Constraints
\(1\le t\le 1e5\\ 1\le k\le n\le 1e5\\ 0\le A[i]\le 1e9\ (1\le i\le 26)\\ Sum\ of\ n\ over\ t\ test\ cases\ does\ not\ exceed\ 1e5\)