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.*;
import java.util.*;

public class Main1 {
    static InputReader reader;
    static OutputWriter writer;

    public static void main(String[] args) throws FileNotFoundException {
        reader = new InputReader(System.in);
        writer = new OutputWriter(System.out);

        int n = reader.nextInt();
        int m = reader.nextInt();

        char[] table = new char[26];
        for (int i=0;i<26;i++){
            table[i] = (char)(i + 'a');
        }
        String brand = reader.nextLine();
        char[] b = brand.toCharArray();
        for (int j=0;j<m;j++){
            char x = reader.next().charAt(0);
            char y = reader.next().charAt(0);
            for (int i=0;i<26;i++){
                if (table[i] == x){
                    table[i] = y;
                }else if(table[i] == y){
                    table[i] = x;
                }
            }
        }
        for (int i=0;i<n;i++){
            writer.print(table[b[i]-'a']);
        }
        writer.println();
        writer.flush();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (Exception e) {
                    return null;
                }
            }
            return tokenizer.nextToken();
        }
        public char nextChar(){
            try {
                char c = '\0';
                while(c == '\0' || c == '\n' || c == '\r')
                    c = (char) reader.read();
                return c;
            }catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public String nextLine(){
            if(tokenizer != null && tokenizer.hasMoreTokens()){
                StringBuilder sb = new StringBuilder(tokenizer.nextToken());
                while(tokenizer.hasMoreTokens()){
                    sb.append(" ").append(tokenizer.nextToken());
                }
                return sb.toString();
            }else{
                try {
                    return reader.readLine();
                }catch(Exception e){
                    return null;
                }
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    }

    static class OutputWriter {
        public BufferedWriter writer;
        OutputWriter(OutputStream stream) {
            writer = new BufferedWriter(new OutputStreamWriter(stream));
        }
        public void print(String string){
            try {
                writer.write(string, 0, string.length());
            }catch(Exception e){e.printStackTrace();}
        }
        public void print(char c){
            try {
                writer.write(c);
            }catch(Exception e){e.printStackTrace();}
        }
        public void print(String format, Object... args) {
            try {
                String string = String.format(format, args);
                writer.write(string, 0, string.length());
            }catch(Exception e){e.printStackTrace();}
        }
        public void print(int x){
            try {
                String string = String.format("%d", x);
                writer.write(string, 0, string.length());
            }catch(Exception e){e.printStackTrace();}
        }
        public void print(double x){
            try {
                int x_int = (int) (x * 100 + 1e-6); // add 1e-6 to avoid precision error when converting to int
                String string = String.format("%d.%02d", x_int/100, x_int%100);
                writer.write(string, 0, string.length());
            }catch(Exception e){e.printStackTrace();}
        }
        public void print(long x){
            try {
                String string = String.format("%d", x);
                writer.write(string, 0, string.length());
            }catch(Exception e){e.printStackTrace();}
        }
        public void println(String string){
            print(string);
            newline();
        }
        public void println(char c){
            print(c);
            newline();
        }
        public void println(String format, Object... args) {
            print(format, args);
            newline();
        }
        public void println(int x){
            print(x);
            newline();
        }
        public void println(long x){
            print(x);
            newline();
        }
        public void println(double x){
            print(x);
            newline();
        }
        public void println(){
            newline();
        }

        private void newline() {
            try {
                writer.newLine();
            }catch(Exception e){e.printStackTrace();}
        }
        private void flush(){
            try {
                writer.flush();
            }catch(Exception e){e.printStackTrace();}
        }
    }

    static class BitBoolean{
        final static int SIZE = 32;
        int[] bits;

        public BitBoolean(int size) {
            bits = new int[size/SIZE];
        }
        public int setTrue(int i){
            return setBit(bits[i/SIZE], i%SIZE);
        }
        public int setFalse(int i){
            return clearBit(bits[i / SIZE], i % SIZE);
        }
        public boolean isTrue(int i){
            return isOn(bits[i/SIZE], i%SIZE) > 0;
        }
        public int toggle(int i){
            return toggleBit(bits[i/SIZE], i%SIZE);
        }
        public void allTrue(){
            for (int i=0;i<bits.length;i++){
                bits[i] = setAll(SIZE);
            }
        }

        int setBit(int S, int j) { return S | (1 << j); }

        int isOn(int S, int j) { return S & (1 << j); }

        int clearBit(int S, int j) { return S & ~(1 << j); }

        int toggleBit(int S, int j) { return S ^ (1 << j); }

        int lowBit(int S) { return S & (-S); }

        int setAll(int n) { return (1 << n) - 1; }

        int modulo(int S, int N) { return ((S) & (N - 1)); } // returns S % N, where N is a power of 2

        int isPowerOfTwo(int S) { return (S & (S - 1)) == 0 ? 1 : 0; }

        int nearestPowerOfTwo(int S) { return ((int)Math.pow(2.0, (int)((Math.log((double)S) / Math.log(2.0)) + 0.5))); }

        int turnOffLastBit(int S) { return ((S) & (S - 1)); }

        int turnOnLastZero(int S) { return ((S) | (S + 1)); }

        int turnOffLastConsecutiveBits(int S) { return ((S) & (S + 1)); }

        int turnOnLastConsecutiveZeroes(int S) { return ((S) | (S - 1)); }

        void printSet(int vS) {             // in binary representation
            System.out.printf("S = %2d = ", vS);
            Stack<Integer> st = new Stack<Integer>();
            while (vS > 0) {
                st.push(vS % 2);
                vS /= 2;
            }
            while (!st.empty()) {                          // to reverse the print order
                System.out.printf("%d", st.peek());
                st.pop();
            }
            System.out.printf("\n");
        }
    }

    /**
     * Permuatations
     */

    // simply prints all permutation - to see how it works
    private static void printPermutations( Comparable[] c ) {
        System.out.println( Arrays.toString( c ) );
        while ( ( c = nextPermutation( c ) ) != null ) {
            System.out.println( Arrays.toString( c ) );
        }
    }

    // modifies c to next permutation or returns null if such permutation does not exist
    private static Comparable[] nextPermutation( final Comparable[] c ) {
        // 1. finds the largest k, that c[k] < c[k+1]
        int first = getFirst( c );
        if ( first == -1 ) return null; // no greater permutation
        // 2. find last index toSwap, that c[k] < c[toSwap]
        int toSwap = c.length - 1;
        while ( c[ first ].compareTo( c[ toSwap ] ) >= 0 )
            --toSwap;
        // 3. swap elements with indexes first and last
        swap( c, first++, toSwap );
        // 4. reverse sequence from k+1 to n (inclusive)
        toSwap = c.length - 1;
        while ( first < toSwap )
            swap( c, first++, toSwap-- );
        return c;
    }

    // finds the largest k, that c[k] < c[k+1]
    // if no such k exists (there is not greater permutation), return -1
    private static int getFirst( final Comparable[] c ) {
        for ( int i = c.length - 2; i >= 0; --i )
            if ( c[ i ].compareTo( c[ i + 1 ] ) < 0 )
                return i;
        return -1;
    }

    // swaps two elements (with indexes i and j) in array
    private static void swap( final Comparable[] c, final int i, final int j ) {
        final Comparable tmp = c[ i ];
        c[ i ] = c[ j ];
        c[ j ] = tmp;
    }

    private static int length(long num){
        int count = 0;
        while(num > 0){
            count ++;
            num /= 10;
        }
        return count;
    }
    private static int length(int num){
        int count = 0;
        while(num > 0){
            count ++;
            num /= 10;
        }
        return count;
    }
}