Alice's Swap Pairs
Bob wrote a word on a row of n letter tiles and handed it to Alice together with a list of m pairs of positions. Alice may pick any pair (a, b) from the list and swap the tiles at positions a and b. She may do this as many times as she likes, in any order, reusing pairs freely (or doing nothing at all). Alice wants to end up with the lexicographically smallest word possible. Help her find it.
Formally, you are given a string s of length n consisting of lowercase English letters and m pairs (a_i, b_i) of positions (1-indexed). In one operation you may choose any i and exchange the characters s[a_i] and s[b_i]. Among all strings obtainable by a finite sequence of operations (possibly empty), print the lexicographically smallest one.
Input
The first line contains two integers n and m (1 ≤ n ≤ 2·10^5, 0 ≤ m ≤ 2·10^5).
The second line contains the string s of exactly n lowercase English letters.
Each of the next m lines contains two integers a_i and b_i (1 ≤ a_i, b_i ≤ n). A pair may have a_i = b_i (swapping a tile with itself does nothing), and the same pair may appear several times.
Output
Print the lexicographically smallest string Alice can obtain.
Notes
In the first example, the pairs (1, 4) and (4, 2) let Alice move tiles freely among positions 1, 2 and 4 (for instance, swapping along (1, 4), then (4, 2), then (1, 4) again exchanges positions 1 and 2). Those positions hold d, c, a, so the best she can do is put a, c, d there in that order. Positions 3 and 5 are linked to each other, so they receive b and e.
In the second example there are no pairs, so the word cannot change.