$K$ Integers

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

You are given a string ss of length nn.

A sequence of integers tt is an index sequence if 1t_1<t_2<<t_kn1 \leq t\_1 < t\_2 < \ldots < t\_k \leq n, where kk is the length of tt.

A string corresponding to an index sequence tt is the the following string: s_t_1s_t_2s_t_ks\_{t\_1} s\_{t\_2} \ldots s\_{t\_k}. Note that it is always a subsequence of ss.

You are given an index sequence. Find the lexicographically smallest string which corresponds to some index sequence which contains the given one as a subsequence.

입력

The first line contains the string ss consisting of nn (1n51051 \leq n \leq 5 \cdot 10^5) lowercase English letters.

The second line contains a single integer kk (1kn1 \leq k \leq n), length of tt.

The third line contains kk integers t_it\_i (1t_in1 \leq t\_i \leq n). tt is an index sequence.

출력

Print a single string --- the answer to the problem.