Codeforces Round 449 (Div. 2)
A
Scarborough Fair
Codeforces
800
原题
←B →
翻译中…

Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.

翻译中…

Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.

翻译中…

Willem asks his friend, Grick for directions, Grick helped them, and gave them a task.

翻译中…

Although the girl wants to help, Willem insists on doing it by himself.

翻译中…

Grick gave Willem a string of length $*n*$.

翻译中…

Willem needs to do $*m*$ operations, each operation has four parameters $*l*, *r*, *c*_{1}, *c*_{2}$, which means that all symbols $*c*_{1}$ in range $[*l*, *r*]$ (from $*l*$-th to $*r*$-th, including $*l*$ and $*r*$) are changed into $*c*_{2}$. String is 1-indexed.

翻译中…

Grick wants to know the final string after all the $*m*$ operations.

翻译中…

Input

翻译中…

The first line contains two integers $*n*$ and $*m*$ $(1 ≤ *n*, *m* ≤ 100)$.

翻译中…

The second line contains a string $*s*$ of length $*n*$, consisting of lowercase English letters.

翻译中…

Each of the next $*m*$ lines contains four parameters $*l*, *r*, *c*_{1}, *c*_{2}$ ($1 ≤ *l* ≤ *r* ≤ *n*$, $*c*_{1}, *c*_{2}$ are lowercase English letters), separated by space.

翻译中…

Output

翻译中…

Output string $*s*$ after performing $*m*$ operations described above.

翻译中…

Note

翻译中…

For the second example:

翻译中…

After the first operation, the string is wxxak.

翻译中…

After the second operation, the string is waaak.

翻译中…

After the third operation, the string is gaaak.

翻译中…

样例

Input #1
3 1
ioi
1 1 i n
Output #1
noi
InputCopy OutputCopy
Input #2
5 3
wxhak
3 3 h x
1 5 x a
1 3 w g
Output #2
gaaak
InputCopy OutputCopy
题目信息
题号
897A
时间限制
2 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。