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.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class B {
	MyScanner sc = new MyScanner();
	Scanner sc2 = new Scanner(System.in);
	long start = System.currentTimeMillis();
	long fin = System.currentTimeMillis();
	final int MOD = 1000000007;
	int[] dx = { 1, 0, 0, -1 };
	int[] dy = { 0, 1, -1, 0 };

	void run() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		char[] s = sc.next().toCharArray();
		char[][] rep = new char[m][2];
		for (int i = 0; i < m; i++) {
			String c1 = sc.next();
			String c2 = sc.next();
			rep[i][0] = c1.charAt(0);
			rep[i][1] = c2.charAt(0);
		}

		// それぞれの文字がどの文字に変化しているかを保持
		HashMap<Character, Character> to = new HashMap<Character, Character>();
		// 一番上の親参照要(最新の子)
		HashMap<Character, Character> child = new HashMap<Character, Character>();

		for (int i = 0; i < m; i++) {
			if (rep[i][0] == rep[i][1])
				continue;

			// rep[0] <-> rep[1]
			boolean addParent1 = false;
			boolean addParent2 = false;
			char topParent1 = '(';
			char topParent2 = '(';

			if (!child.containsKey(rep[i][0])) {
				addParent1 = true;
			} else {
				topParent1 = child.get(rep[i][0]);
			}
			if (!child.containsKey(rep[i][1])) {
				addParent2 = true;
			} else {
				topParent2 = child.get(rep[i][1]);
			}

			// 　最新の子にrep[0]が含まれる
			if (!addParent1) {
				to.put(topParent1, rep[i][1]);
				child.remove(rep[i][0]);
			} else {
				// 含まれていないので新しく親として作る
				to.put(rep[i][0], rep[i][1]);
				child.put(rep[i][1], rep[i][0]);
			}

			// 　最新の子にrep[1]が含まれる
			if (!addParent2) {
				to.put(topParent2, rep[i][0]);
				child.remove(rep[i][1]);
			} else {
				// 含まれていないので新しく親として作る
				to.put(rep[i][1], rep[i][0]);
				child.put(rep[i][0], rep[i][1]);
			}

			if (!addParent1) {
				child.put(rep[i][1], topParent1);
			} else {
				child.put(rep[i][1], rep[i][0]);
			}
			if (!addParent2) {
				child.put(rep[i][0], topParent2);
			}
		}
//		debug(to);
//		debug(child);
		for (int i = 0; i < n; i++) {
			if(to.containsKey(s[i])) {
				 s[i] = to.get(s[i]);
			}
		}
		System.out.println(String.valueOf(s));
	}

	public static void main(String[] args) {
		new B().run();
	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	void debug2(int[][] array) {
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.print(array[i][j]);
			}
			System.out.println();
		}
	}

	boolean inner(int h, int w, int limH, int limW) {
		return 0 <= h && h < limH && 0 <= w && w < limW;
	}

	void swap(int[] x, int a, int b) {
		int tmp = x[a];
		x[a] = x[b];
		x[b] = tmp;
	}

	// find minimum i (a[i] >= border)
	int lower_bound(int a[], int border) {
		int l = -1;
		int r = a.length;
		while (r - l > 1) {
			int mid = (l + r) / 2;
			if (border <= a[mid]) {
				r = mid;
			} else {
				l = mid;
			}
		}
		// r = l + 1
		return r;
	}

	boolean palindrome(String s) {
		for (int i = 0; i < s.length() / 2; i++) {
			if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
				return false;
			}
		}
		return true;
	}

	class MyScanner {
		int nextInt() {
			try {
				int c = System.in.read();
				while (c != '-' && (c < '0' || '9' < c))
					c = System.in.read();
				if (c == '-')
					return -nextInt();
				int res = 0;
				do {
					res *= 10;
					res += c - '0';
					c = System.in.read();
				} while ('0' <= c && c <= '9');
				return res;
			} catch (Exception e) {
				return -1;
			}
		}

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

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

		String next() {
			try {
				StringBuilder res = new StringBuilder("");
				int c = System.in.read();
				while (Character.isWhitespace(c))
					c = System.in.read();
				do {
					res.append((char) c);
				} while (!Character.isWhitespace(c = System.in.read()));
				return res.toString();
			} catch (Exception e) {
				return null;
			}
		}

		int[] nextIntArray(int n) {
			int[] in = new int[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextInt();
			}
			return in;
		}

		int[][] nextInt2dArray(int n, int m) {
			int[][] in = new int[n][m];
			for (int i = 0; i < n; i++) {
				in[i] = nextIntArray(m);
			}
			return in;
		}

		double[] nextDoubleArray(int n) {
			double[] in = new double[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextDouble();
			}
			return in;
		}

		long[] nextLongArray(int n) {
			long[] in = new long[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextLong();
			}
			return in;
		}

		char[][] nextCharField(int n, int m) {
			char[][] in = new char[n][m];
			for (int i = 0; i < n; i++) {
				String s = sc.next();
				for (int j = 0; j < m; j++) {
					in[i][j] = s.charAt(j);
				}
			}
			return in;
		}
	}
}