Problem: The name of one small but proud corporation consists of n lowercase English letters. The Corporation has decided to try rebranding — an active marketing strategy, that includes a set of measures to change either the brand (both for the company and the goods it produces) or its components: the name, the logo, the slogan. They decided to start with the name.

For this purpose the corporation has consecutively hired m designers. Once a company hires the i-th designer, he immediately contributes to the creation of a new corporation name as follows: he takes the newest version of the name and replaces all the letters xi by yi, and all the letters yi by xi. This results in the new version. It is possible that some of these letters do no occur in the string. It may also happen that xi coincides with yi. The version of the name received after the work of the last designer becomes the new name of the corporation.

Manager Arkady has recently got a job in this company, but is already soaked in the spirit of teamwork and is very worried about the success of the rebranding. Naturally, he can't wait to find out what is the new name the Corporation will receive.

Satisfy Arkady's curiosity and tell him the final version of the name.

Input

The first line of the input contains two integers n and m (1 ≤ n, m ≤ 200 000) — the length of the initial name and the number of designers hired, respectively.

The second line consists of n lowercase English letters and represents the original name of the corporation.

Next m lines contain the descriptions of the designers' actions: the i-th of them contains two space-separated lowercase English letters xi and yi.

Output

Print the new name of the corporation.

Examples

Input

6 1
police
p m


Output

molice


Input

11 6
abacabadaba
a b
b c
a d
e g
f a
b b


Output

cdcbcdcfcdc

Note

In the second sample the name of the corporation consecutively changes as follows:

<image>

<image>

<image>

<image>

<image>

<image>

Solution (in JAVA):

Solution:


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {   
    
    static char prevf;
    static char prevs;
    
    static char currentf;
    static char currents;
    
    static int dpf[];
    static int dps[];
    static char ans[];
    
    
    static int [] charact = new int [26];
    //static char [] replace;
    static ArrayList<Character> replace [];
    static final char [] letters = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
    
    
    public static void rebrand(int i){
        if(i >= ans.length)
            return;
        
        if (ans[i] == currentf){
            ans[i] = currents;
            //dps[i] = i;
        }
        else if (ans[i] == currents){
            ans[i] = currentf;
            //dpf[i] = i;
        }
        rebrand(++i);
    }
    
    /*public static void wrongApproach(){
        ans = s.toCharArray();
        /*while (t-- > 0){
            st = new StringTokenizer(br.readLine());
            String s1 = st.nextToken();
            String s2 = st.nextToken();
            currentf = s1.charAt(0);
            currents = s2.charAt(0);
            if (currentf == currents)
                continue;
            rebrand(0);
            //System.out.println(1);
            //prevf = s1.charAt(0);
            //prevs = s2.charAt(0);
            //System.out.println(new String(ans));
        }
        
        
        //replace = new char[26];
        //Arrays.fill(replace, '0');
        replace = new ArrayList[26];
        for (int i = 0;i < replace.length;i++)
            replace[i] = new ArrayList<>();
        //System.out.println(Arrays.toString(replace));
        //System.out.println(Arrays.toString(ans));
        while (t-- > 0){
            st = new StringTokenizer(br.readLine());
            char first = st.nextToken().charAt(0);
            char second = st.nextToken().charAt(0);
            replace[(first - 'a')].add(second);
            replace[(second - 'a')].add(first);
            //System.out.println(Arrays.toString(replace));
            //System.out.println(Arrays.toString(letters));
        }
        
        //System.out.println(Arrays.toString(replace));
        //System.out.println(Arrays.toString(letters));
        //System.out.println(new String (ans));
        for (int i = 0;i < replace.length;i++){
            for (int j = 0; j < replace[i].size();) {
                for (int k = 0; k < ans.length; k++) {
                    if (letters[i] == ans[k])
                        ans[k] = replace[i].get(j);
                    else if(ans[k] == replace[i].get(j)){
                        //System.out.println(ans[k]+" "+replace[i].get(j)+" "+letters[i]);
                        ans[k] = letters[i];
                    }
                }
                //System.out.println(i);
                if (!replace[i].isEmpty()){
                    char r = replace[i].remove(0);
                //System.out.println(r);
                    if (!replace[r - 'a'].isEmpty())
                        replace[r - 'a'].remove(0);
                }
                //System.out.println();
                //System.out.println(j);
                //System.out.println(Arrays.toString(replace));
                //System.out.println(Arrays.toString(letters));
            }
        }
        
        /*for (int i = 0;i < replace.length;i++){
            for (int j = 0; j < ans.length; j++) {
                if(letters[i] == ans[j] && replace[i] != '0')
                    ans[j] = replace[i];
                //System.out.println(new String(ans));
            }
        }
        //System.out.println(Arrays.toString(dpf) + Arrays.toString(dps));
        System.out.println(new String(ans));
    }*/

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int strlength = Integer.parseInt(st.nextToken());
        int t = Integer.parseInt(st.nextToken());
        String s = br.readLine();
        for (int i = 0;i < 26;i++)
            charact[i] = i;
        while (t-- > 0){
            st = new StringTokenizer(br.readLine());
            char first = st.nextToken().charAt(0);
            char second = st.nextToken().charAt(0);
            int f = first - 'a';
            int sec = second - 'a';
            for (int i = 0;i < 26;i++){
                if (charact[i] == f)
                    charact[i] = sec;
                else if (charact[i] == sec)
                    charact[i] = f;
            }
            
        }
        char [] ans = new char[strlength];
        for (int i = 0; i < s.length(); i++) {
            ans[i] = Character.toChars(charact[(s.charAt(i) - 'a')] + 'a')[0];
        }
        //System.out.println();
        System.out.println(new String(ans));
    }
}