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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int MAX_CHARS = 256;
long long countDigit(long long n) { return floor(log10(n) + 1); }
long long ipow(long long base, long long exp) {
  long long result = 1;
  for (;;) {
    if (exp & 1) result *= base;
    exp >>= 1;
    if (!exp) break;
    base *= base;
  }
  return result;
}
long long divi(long long n) {
  long long r;
  if (n % 2 == 0) {
    return 2;
  }
  if (n % 3 == 0) {
    return 3;
  } else {
    r = floor(sqrt(n));
    long long d = 5;
    while ((n % d) && (d < n / d)) d += 2;
    if (n % d == 0)
      return d;
    else
      return n;
  }
}
int printmaxSubArraySum(int a[], int size) {
  int max_so_far = INT_MIN, max_ending_here = 0, start = 0, end = 0, s = 0;
  for (int i = 0; i < size; i++) {
    max_ending_here += a[i];
    if (max_so_far < max_ending_here) {
      max_so_far = max_ending_here;
      start = s;
      end = i;
    }
    if (max_ending_here < 0) {
      max_ending_here = 0;
      s = i + 1;
    }
  }
  cout << max_so_far << endl;
  cout << "Starting index " << start << endl << "Ending index " << end << endl;
}
bool isSubsetSum(int arr[], int n, int sum) {
  bool subset[2][sum + 1];
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= sum; j++) {
      if (j == 0)
        subset[i % 2][j] = true;
      else if (i == 0)
        subset[i % 2][j] = false;
      else if (arr[i - 1] <= j)
        subset[i % 2][j] =
            subset[(i + 1) % 2][j - arr[i - 1]] || subset[(i + 1) % 2][j];
      else
        subset[i % 2][j] = subset[(i + 1) % 2][j];
    }
  }
  return subset[n % 2][sum];
}
void printCharWithFreq(string str) {
  int n = str.size();
  int freq[26];
  memset(freq, 0, sizeof(freq));
  for (int i = 0; i < n; i++) freq[str[i] - 'a']++;
  for (int i = 0; i < n; i++) {
    if (freq[str[i] - 'a'] != 0) {
      cout << str[i] << freq[str[i] - 'a'] << " ";
      freq[str[i] - 'a'] = 0;
    }
  }
}
string evenlength(string n) {
  string res = n;
  for (int j = n.length() - 1; j >= 0; --j) res += n[j];
  return res;
}
long long mostFrequent(vector<long long> arr, long long n) {
  sort(arr.begin(), arr.end());
  long long max_count = 1, res = arr[0], curr_count = 1;
  for (long long i = 1; i < n; i++) {
    if (arr[i] == arr[i - 1])
      curr_count++;
    else {
      if (curr_count > max_count) {
        max_count = curr_count;
        res = arr[i - 1];
      }
      curr_count = 1;
    }
  }
  if (curr_count > max_count) {
    max_count = curr_count;
    res = arr[n - 1];
  }
  return res;
}
bool ck(int N) {
  if ((sqrt(N) - floor(sqrt(N))) != 0) return false;
  return true;
}
long long gcs(long long N) {
  if (ck(N)) {
    return N;
  }
  long long aboveN = -1, belowN = -1;
  long long n1;
  n1 = N + 1;
  while (true) {
    if (ck(n1)) {
      aboveN = n1;
      break;
    } else
      n1++;
  }
  return aboveN;
}
bool is_prime(long long n) {
  if (n == 1) {
    return false;
  }
  long long i = 2;
  while (i * i <= n) {
    if (n % i == 0) {
      return false;
    }
    i += 1;
  }
  return true;
}
long long leastPrimeFactor(long long n) {
  vector<int> least_prime(n + 1, 0);
  least_prime[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (least_prime[i] == 0) {
      least_prime[i] = i;
      for (int j = 2 * i; j <= n; j += i)
        if (least_prime[j] == 0) least_prime[j] = i;
    }
  }
  return least_prime[n];
}
long long smallestDivisor(long long n) {
  if (n % 2 == 0) return 2;
  for (long long i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return i;
  }
  return n;
}
long long countDistinct(long long arr[], long long n) {
  unordered_set<int> s;
  long long res = 0;
  for (long long i = 0; i < n; i++) {
    if (s.find(arr[i]) == s.end()) {
      s.insert(arr[i]);
      res++;
    }
  }
  return res;
}
void countFreq(long long arr[], long long n) {
  vector<long long> v;
  vector<bool> visited(n, false);
  for (long long i = 0; i < n; i++) {
    if (visited[i] == true) continue;
    long long count = 1;
    for (long long j = i + 1; j < n; j++) {
      if (arr[i] == arr[j]) {
        visited[j] = true;
        count++;
      }
    }
    v.push_back(count);
  }
  long long f = 0;
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
    if (v[i] < 3) {
      f = 1;
    }
  }
  if (f == 1) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
long long mcm(long long p[], long long n) {
  long long m[n][n];
  long long j, k, q;
  for (long long i = 1; i < n; i++) {
    m[i][i] = 0;
  }
  for (long long L = 2; L < n; L++) {
    for (long long i = 1; i < n - L + 1; i++) {
      j = i + L - 1;
      m[i][j] = INT_MAX;
      for (k = i; k <= j - 1; k++) {
        q = m[i][k] + m[k + 1][j] + p[i - 1] * p[k] * p[j];
        if (q < m[i][j]) m[i][j] = q;
      }
    }
  }
  return m[1][n - 1];
}
long long lis(long long a[], long long n) {
  int lis[n];
  lis[0] = 1;
  for (int i = 1; i < n; i++) {
    lis[i] = 1;
    for (int j = 0; j < i; j++) {
      if (a[i] >= a[j] && lis[i] < lis[j] + 1) {
        lis[i] = lis[j] + 1;
      }
    }
  }
  sort(lis, lis + n);
}
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
long long findSubString(string str) {
  int n = str.length();
  int dist_count = 0;
  bool visited[MAX_CHARS] = {false};
  for (int i = 0; i < n; i++) {
    if (visited[str[i]] == false) {
      visited[str[i]] = true;
      dist_count++;
    }
  }
  int start = 0, start_index = -1, min_len = INT_MAX;
  int count = 0;
  int curr_count[MAX_CHARS] = {0};
  for (int j = 0; j < n; j++) {
    curr_count[str[j]]++;
    if (curr_count[str[j]] == 1) count++;
    if (count == dist_count) {
      while (curr_count[str[start]] > 1) {
        if (curr_count[str[start]] > 1) curr_count[str[start]]--;
        start++;
      }
      int len_window = j - start + 1;
      if (min_len > len_window) {
        min_len = len_window;
        start_index = start;
      }
    }
  }
  return str.substr(start_index, min_len).length();
}
int bs(long long arr[], long long l, long long r, long long x) {
  while (l <= r) {
    int m = l + (r - l) / 2;
    if (arr[m] == x) return m;
    if (arr[m] < x)
      l = m + 1;
    else
      r = m - 1;
  }
  return -1;
}
void cutrod(int n, int a[], int s) {
  int i;
  int dp[n + 1];
  for (i = 0; i < n + 1; i++) {
    dp[i] = INT_MIN;
  }
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < s; j++)
      if (a[j] <= i) dp[i] = max(dp[i], dp[i - a[j]] + 1);
  }
  cout << dp[n] << endl;
}
int lcs2(string &X, string &Y) {
  int m = X.length(), n = Y.length();
  int L[2][n + 1];
  bool bi;
  for (int i = 0; i <= m; i++) {
    bi = i & 1;
    for (int j = 0; j <= n; j++) {
      if (i == 0 || j == 0)
        L[bi][j] = 0;
      else if (X[i - 1] == Y[j - 1])
        L[bi][j] = L[1 - bi][j - 1] + 1;
      else
        L[bi][j] = max(L[1 - bi][j], L[bi][j - 1]);
    }
  }
  return L[bi][n];
}
bool ckpal(string s, long long n) {
  for (long long i = 0; i < n; i++) {
    if (s[i] != s[n - i - 1]) {
      return false;
      break;
    }
  }
  return true;
}
bool is_reverse(string s1, string s2, long long m) {
  long long l1 = m;
  long long l2 = m;
  long long index = 0;
  if (index > l1 - 1) return true;
  if (l1 != l2 || s1[index] != s2[l2 - index - 1]) return false;
  ++index;
  return is_reverse(s1, s2, index);
}
bool compare(char arr1[], char arr2[]) {
  for (int i = 0; i < 256; i++)
    if (arr1[i] != arr2[i]) return false;
  return true;
}
bool search(string pat, string txt) {
  int M = pat.size(), N = txt.size();
  char countP[256] = {0}, countTW[256] = {0};
  for (int i = 0; i < M; i++) {
    (countP[pat[i]])++;
    (countTW[txt[i]])++;
  }
  for (int i = M; i < N; i++) {
    if (compare(countP, countTW)) return true;
    (countTW[txt[i]])++;
    countTW[txt[i - M]]--;
  }
  if (compare(countP, countTW)) return true;
  return false;
}
long long sd(long long n) {
  if (n % 2 == 0) return 2;
  for (long long i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return i;
  }
  return n;
}
bool isorted(long long a[], long long n) {
  for (long long i = 0; i < n - 1; i++) {
    if (a[i] > a[i + 1]) {
      return false;
    }
  }
  return true;
}
bool isSubsetSum(long long arr[], long long n, long long sum) {
  bool subset[n + 1][sum + 1];
  for (int i = 0; i <= n; i++) subset[i][0] = true;
  for (int i = 1; i <= sum; i++) subset[0][i] = false;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= sum; j++) {
      if (j < arr[i - 1]) subset[i][j] = subset[i - 1][j];
      if (j >= arr[i - 1])
        subset[i][j] = subset[i - 1][j] || subset[i - 1][j - arr[i - 1]];
    }
  }
  return subset[n][sum];
}
int findMinRec(int arr[], int i, int sumCalculated, int sumTotal) {
  if (i == 0) return abs((sumTotal - sumCalculated) - sumCalculated);
  return min(findMinRec(arr, i - 1, sumCalculated + arr[i - 1], sumTotal),
             findMinRec(arr, i - 1, sumCalculated, sumTotal));
}
int findMin(int arr[], int n) {
  int sumTotal = 0;
  for (int i = 0; i < n; i++) sumTotal += arr[i];
  return findMinRec(arr, n, 0, sumTotal);
}
unsigned long long ceil(unsigned long long n, unsigned long long i) {
  if (n == 0) return 0;
  return (n - 1) / i + 1;
}
long long digisum(long long n) {
  long long s = 0;
  while (n != 0) {
    s += n % 10;
    n /= 10;
  }
  return s;
}
long long mio(vector<long long> v, long long n) {
  long long c = 0;
  for (long long i = 0; i < n; i++) {
    if (v[i] != -1) {
      c++;
    }
  }
  return c;
}
int count(int n) {
  int m = 3;
  int S[3] = {3, 5, 10};
  int table[n + 1];
  memset(table, 0, sizeof(table));
  table[0] = 1;
  for (int i = 0; i < m; i++)
    for (int j = S[i]; j <= n; j++) table[j] += table[j - S[i]];
  return table[n];
}
long long maxHist(long long row[], long long C) {
  stack<long long> result;
  long long top_val;
  long long max_area = 0;
  long long area = 0;
  long long i = 0;
  while (i < C) {
    if (result.empty() || row[result.top()] <= row[i])
      result.push(i++);
    else {
      top_val = row[result.top()];
      result.pop();
      area = top_val * i;
      if (!result.empty()) area = top_val * (i - result.top() - 1);
      max_area = max(area, max_area);
    }
  }
  while (!result.empty()) {
    top_val = row[result.top()];
    result.pop();
    area = top_val * i;
    if (!result.empty()) area = top_val * (i - result.top() - 1);
    max_area = max(area, max_area);
  }
  return max_area;
}
int lenOfLongIncSubArr(int arr[], int n) {
  int max = 1, len = 1;
  for (int i = 1; i < n; i++) {
    if (arr[i] < arr[i - 1])
      len++;
    else {
      if (max < len) max = len;
      len = 1;
    }
  }
  if (max < len) max = len;
  return max;
}
int bitonic(int arr[], int n) {
  int inc[n];
  int dec[n];
  int i, max;
  inc[0] = 1;
  dec[n - 1] = 1;
  for (i = 1; i < n; i++) inc[i] = (arr[i] >= arr[i - 1]) ? inc[i - 1] + 1 : 1;
  for (i = n - 2; i >= 0; i--)
    dec[i] = (arr[i] >= arr[i + 1]) ? dec[i + 1] + 1 : 1;
  int len = 0;
  return lenOfLongIncSubArr(dec, n) + lenOfLongIncSubArr(inc, n) - 1;
}
int findBitonicSubarray(int A[], int n) {
  int I[n + 1];
  I[0] = 1;
  for (int i = 1; i <= n; i++) {
    I[i] = 1;
    if (A[i - 1] < A[i]) I[i] = I[i - 1] + 1;
  }
  int D[n + 1];
  D[n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    D[i] = 1;
    if (A[i] > A[i + 1]) D[i] = D[i + 1] + 1;
  }
  int lbs_len = 1;
  int beg = 0, end = 0;
  for (int i = 0; i <= n; i++) {
    if (lbs_len < I[i] + D[i] - 1) {
      lbs_len = I[i] + D[i] - 1;
      beg = i - I[i] + 1;
      end = i + D[i] - 1;
    }
  }
  printf("The length of longest bitonic sub-array is %d\n", lbs_len);
  printf("The longest bitonic sub-array is [%d, %d]", beg, end);
  return lbs_len;
}
int main() {
  int t;
  t = 1;
  while (t--) {
    long long p, n, i, j, m, q;
    cin >> n >> m;
    string s;
    cin >> s;
    char x, y;
    int a[1000];
    for (i = 97; i <= 122; i++) {
      a[i] = i;
    }
    for (i = 0; i < m; i++) {
      cin >> x >> y;
      for (j = 97; j <= 122; j++) {
        if (a[j] == x)
          a[j] = y;
        else if (a[j] == y)
          a[j] = x;
      }
    }
    for (i = 0; i < s.size(); i++) {
      s[i] = a[s[i]];
      cout << s[i];
    }
    cout << endl;
  }
  return 0;
}