#P591B. Rebranding

Rebranding

Rebranding

题面翻译

一个小而骄傲的公司的名字由N小写的英文字母组成。该公司已决定尝试重新品牌化:一个积极的营销策略,其中包括一系列措施来改变品牌(无论是对公司和其生产的产品)或其组成部分:名称,标志,口号。他们决定以这个名字开头。

为此,公司先后聘请了M设计人员。一旦一个公司雇佣了第i个设计师,他立即为创建一个新的公司名称做出贡献:他取名字的最新版本并替换所有的字母x【i】变为y【i】,y【i】变为x【i】

…在最后一个设计师的工作之后,名字的版本变成了公司的新名称。

Arkady经理最近在这家公司找到了一份工作,但是他已经沉浸在团队合作精神中,并且非常担心品牌重塑能不能成功。自然而然地,他迫不及待地想知道公司会收到什么新名称。

满足Arkady的好奇心,告诉他名字的最终版本。

题目描述

The name of one small but proud corporation consists of n 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 m designers. Once a company hires the i 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 x_{i} by yi y_{i} , and all the letters yi y_{i} by xi x_{i} . 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 x_{i} coincides with yi y_{i} . 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.

输入格式

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

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

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

输出格式

Print the new name of the corporation.

样例 #1

样例输入 #1

6 1
police
p m

样例输出 #1

molice

样例 #2

样例输入 #2

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

样例输出 #2

cdcbcdcfcdc

提示

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