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*<sub class="lower-index">1</sub>, *c*<sub class="lower-index">2</sub>, which means that all symbols *c*<sub class="lower-index">1</sub> in range [*l*, *r*] (from *l*-th to *r*-th, including *l* and *r*) are changed into *c*<sub class="lower-index">2</sub>. String is 1-indexed.

Grick wants to know the final string after all the *m* operations.
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*<sub class="lower-index">1</sub>, *c*<sub class="lower-index">2</sub> (1 ≤ *l* ≤ *r* ≤ *n*, *c*<sub class="lower-index">1</sub>, *c*<sub class="lower-index">2</sub> are lowercase English letters), separated by space.
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.
3 1
ioi
1 1 i n
noi
5 3
wxhak
3 3 h x
1 5 x a
1 3 w g
gaaak
9 51
bhfbdcgff
2 3 b b
2 8 e f
3 8 g f
5 7 d a
1 5 e b
3 4 g b
6 7 c d
3 6 e g
3 6 e h
5 6 a e
7 9 a c
4 9 a h
3 7 c b
6 9 b g
1 7 h b
4 5 a e
3 9 f a
1 2 c h
4 8 a c
3 5 e d
3 4 g f
2 3 d h
2 3 d e
1 7 d g
2 6 e g
2 3 d g
5 5 h h
2 8 g d
8 9 a f
5 9 c e
1 7 f d
1 6 e e
5 7 c a
8 9 b b
2 6 e b
6 6 g h
1 2 b b
1 5 a f
5 8 f h
1 5 e g
3 9 f h
6 8 g a
4 6 h g
1 5 f a
5 6 a c
4 8 e d
1 4 d g
7 8 b f
5 6 h b
3 9 c e
1 9 b a
aahaddddh
28 45
dcbbaddjhbeefjadjchgkhgggfha
10 25 c a
13 19 a f
12 28 e d
12 27 e a
9 20 b e
7 17 g d
22 26 j j
8 16 c g
14 16 a d
3 10 f c
10 26 d b
8 17 i e
10 19 d i
6 21 c j
7 22 b k
17 19 a i
4 18 j k
8 25 a g
10 27 j e
9 18 g d
16 23 h a
17 26 k e
8 16 h f
1 15 d f
22 28 k k
11 20 c k
6 11 b h
17 17 e i
15 22 g h
8 18 c f
4 16 e a
8 25 b c
6 24 d g
5 9 f j
12 19 i h
4 25 e f
15 25 c j
15 27 e e
11 20 b f
19 27 e k
2 21 d a
9 27 k e
14 24 b a
3 6 i g
2 26 k f
fcbbajjfjaaefefehfahfagggfha
87 5
nfinedeojadjmgafnaogekfjkjfncnliagfchjfcmellgigjjcaaoeakdolchjcecljdeblmheimkibkgdkcdml
47 56 a k
51 81 o d
5 11 j h
48 62 j d
16 30 k m
nfinedeohadjmgafnaogemfjmjfncnliagfchjfcmellgigddckkdekkddlchdcecljdeblmheimkibkgdkcdml
5 16
acfbb
1 2 e f
2 5 a f
2 3 b e
4 4 f a
2 3 f a
1 2 b e
4 5 c d
2 4 e c
1 4 e a
1 3 d c
3 5 e b
3 5 e b
2 2 e d
1 3 e c
3 3 a e
1 5 a a
acebb
94 13
bcaaaaaaccacddcdaacbdaabbcbaddbccbccbbbddbadddcccbddadddaadbdababadaacdcdbcdadabdcdcbcbcbcbbcd
52 77 d d
21 92 d b
45 48 c b
20 25 d a
57 88 d b
3 91 b d
64 73 a a
5 83 b d
2 69 c c
28 89 a b
49 67 c b
41 62 a c
49 87 b c
bcaaaaaaccacddcdaacddaaddcdbdddccdccddddddbdddddcdddcdddccdddcdcdcdcccdcddcdcdcddcdcdcdcdcdbcd
67 39
acbcbccccbabaabcabcaaaaaaccbcbbcbaaaacbbcccbcbabbcacccbbabbabbabaac
4 36 a b
25 38 a a
3 44 b c
35 57 b a
4 8 a c
20 67 c a
30 66 b b
27 40 a a
2 56 a b
10 47 c a
22 65 c b
29 42 a b
1 46 c b
57 64 b c
20 29 b a
14 51 c a
12 55 b b
20 20 a c
2 57 c a
22 60 c b
16 51 c c
31 64 a c
17 30 c a
23 36 c c
28 67 a c
37 40 a c
37 50 b c
29 48 c b
2 34 b c
21 53 b a
26 63 a c
23 28 c a
51 56 c b
32 61 b b
64 67 b b
21 67 b c
8 53 c c
40 62 b b
32 38 c c
accccccccaaaaaaaaaaaaaaaaaaaccccccccccccccccccccccccccccccccccccccc
53 33
hhcbhfafeececbhadfbdbehdfacfchbhdbfebdfeghebfcgdhehfh
27 41 h g
18 35 c b
15 46 h f
48 53 e g
30 41 b c
12 30 b f
10 37 e f
18 43 a h
10 52 d a
22 48 c e
40 53 f d
7 12 b h
12 51 f a
3 53 g a
19 41 d h
22 29 b h
2 30 a b
26 28 e h
25 35 f a
19 31 h h
44 44 d e
19 22 e c
29 44 d h
25 33 d h
3 53 g c
18 44 h b
19 28 f e
3 22 g h
8 17 c a
37 51 d d
3 28 e h
27 50 h h
27 46 f b
hhcbhfbfhfababbbbbbbbbbbbbbbbbeaaeaaeaaeabebdeaahahdh
83 10
fhbecdgadecabbbecedcgfdcefcbgechbedagecgdgfgdaahchdgchbeaedgafdefecdchceececfcdhcdh
9 77 e e
26 34 b g
34 70 b a
40 64 e g
33 78 h f
14 26 a a
17 70 d g
56 65 a c
8 41 d c
11 82 c b
fhbecdgacebabbbebegbgfgbefbggebhgegagebgggfggaafbfggbfagbgggbfggfebgbfbeebebfbdhbdh
1 4
e
1 1 c e
1 1 e a
1 1 e c
1 1 d a
a
71 21
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
61 61 a a
32 56 a a
10 67 a a
7 32 a a
26 66 a a
41 55 a a
49 55 a a
4 61 a a
53 59 a a
37 58 a a
7 63 a a
39 40 a a
51 64 a a
27 37 a a
22 71 a a
4 45 a a
7 8 a a
43 46 a a
19 28 a a
51 54 a a
14 67 a a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
30 4
eaaddabedcbbcccddbabdecadcecce
2 17 c a
16 29 e e
16 21 c b
7 11 b c
eaaddacedacbaaaddbabdecadcecce
48 30
aaaabaabbaababbbaabaabaababbabbbaabbbaabaaaaaaba
3 45 a b
1 14 a a
15 32 a b
37 47 a b
9 35 a b
36 39 b b
6 26 a b
36 44 a a
28 44 b a
29 31 b a
20 39 a a
45 45 a b
21 32 b b
7 43 a b
14 48 a b
14 33 a b
39 44 a a
9 36 b b
4 23 b b
9 42 b b
41 41 b a
30 47 a b
8 42 b a
14 38 b b
3 15 a a
35 47 b b
14 34 a b
38 43 a b
1 35 b a
16 28 b a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbb
89 29
babaabaaabaaaababbbbbbbabbbaaaaababbaababababbababaaabbababaaabbbbaaabaaaaaabaaabaabbabab
39 70 b b
3 56 b b
5 22 b a
4 39 a b
41 87 b b
34 41 a a
10 86 a b
29 75 a b
2 68 a a
27 28 b b
42 51 b a
18 61 a a
6 67 b a
47 63 a a
8 68 a b
4 74 b a
19 65 a b
8 55 a b
5 30 a a
3 65 a b
16 57 a b
34 56 b a
1 70 a b
59 68 b b
29 57 b a
47 49 b b
49 73 a a
32 61 b b
29 42 a a
bbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbaaaabbbbbbbbbbbbbab
59 14
fbebcfabdefbaaedcefdeecababcabebadfbccaaedaebfdaefdbbcbebbe
5 32 e f
8 46 e e
31 43 e f
3 10 e a
53 54 f d
55 59 d a
39 58 e b
54 56 f a
9 40 b e
28 37 d a
7 35 e b
7 56 c f
23 26 e a
15 44 e d
fbabcfabdffbaafdfffdfffababfabfbaafdffaafdabbfdabfdbbfbbbbe
7 17
bbaabab
3 5 a b
5 7 a a
5 5 a a
4 4 b a
7 7 a a
5 6 b b
1 3 b a
6 7 a b
4 6 a b
6 6 a a
2 4 b a
1 7 b a
4 6 b b
2 5 b b
2 5 a b
1 4 a a
4 4 b a
abbabaa
100 1
debaaagbfdgehagadabfgheegggfghghgeeeabgceffeffggcbcegfgebbdhebhfagcgadcbdbabddbcadgbgdebdfehceehcaef
13 99 f c
debaaagbfdgehagadabcgheegggcghghgeeeabgcecceccggcbcegcgebbdhebhcagcgadcbdbabddbcadgbgdebdcehceehcaef
1 1
a
1 1 a b
b
100 1
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1 100 a b
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
2 2
aa
1 2 a b
1 2 b c
cc
3 3
aaa
1 3 a b
1 3 b c
1 3 c d
ddd
2 2
aa
2 2 a b
1 1 a b
bb
"""
from time import*
import random
money = 10000
cheat = input("Enter Cheat code if you know it: ")
if cheat == "SAHAR":
	money += 100000
	print("--Your balans 110000rub--")
print("You have",str(money)+"rub")
ques = input("Magazines or VulkanKazino or 1xbet:")
if ques == "1xbet":
	stavki = int(input("How many stavka you want?"))
	for i in range(stavki):
		stav = input("Input your color! :")
		mon = int(input("Money :"))
		sides = ["black","black","black","red","red","green"]
		money -= mon
		die_1 = random.choice(sides)
		if die_1 == stav:
			if stav == "black":
				money += mon*2
				print("YOU WIN")
				print("You have %.1f rub" %money)
				print()
			if stav == "red":
				money += mon*3
				print("YOU WIN")
				print("You have %.1f rub" %money)
				print()
			if stav == "green":
				money += mon*5
				print("YOU WIN")
				print("You have %.1f rub" %money)
				print()
		else:
			money +=0
			print("YOU LOSE")
			print("You have %.1f rub" %money)
elif ques == "VulkanKazino":
	
	
	pass
#####################################
s = int(input("Choise: CS:GO market = 1 , M.video = 2 , Kayhon = 3   :"))
if s == 1:
	print("----Welcome----")
	while 1:
		print("You have %.1f rub in your Wallet" %money)
		mag = int(input("Choise: 1) M4A1 -> Howl = 50000rub  ,2) AWP -> Afrikan = 50rub  ,3) ak47 -> Firesnake = 10000rub  ,4) Karambit -> ulraviolet = 20000rub   ,5) USP-S-> Kings = 100rub , 0)EXIT from magazine:"))
		if mag == 1:
			if money - 50000 < 0:
				print("Sorry you don't have a money((")
				break
			else:
				money -= 50000
				print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
				print()				
		elif mag == 2:
			if money - 50 < 0:
				print("Sorry you don't have a money((")
				break
			else:
				money -= 50
				print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
		elif mag == 3:
			if money - 10000 < 0:
				print("Sorry you don't have a money((")
				break
			else:
				money -= 10000
				print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
		
		elif mag == 4:
			if money - 20000 < 0:
				print("Sorry you don't have a money((")
				break
			else:
				money -= 20000
				print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
		elif mag == 5:
			if money - 100 < 0:
				print("Sorry you don't have a money((")
				break
			else:
				money -= 100
				print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
			if mag == 0:
				break
#######################################################################################
elif s == 2:
	print("------------------------------------------------------Welcome to M.video--------------------------------------------------")
	while 1:
		print("You have %.1f rub in your Wallet" %money)
		mag1 = int(input("notebooks = 1 , PC = 2 , Game Series PC = 3 , telephones = 4, Exit = 0"))
		if mag1==0:
			break
		if mag1 == 1:
			notebook = int(input("Lenovo ideapad310 : 35000rub = 1 , HP jet black : 30000rub = 2 , fujitsu : 20000rub = 3"))
			################################################################################################################
			if notebook == 1:
				lenovo = int(input("Buy = 1 , Show characters = 2"))
				if lenovo ==  1:
					if money - 35000 < 0:
						print("Sorry you don't have a money((")
						break
					else:
						money -= 35000
						print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
				else:
					print("Color: Silver","\n","RAM:12gb","\n","ROM:1TB","\n","VideoCard:Nvidia Geforce 930MX and intelHDgraphics9700")
					povt = int(input("Do you want to buy it?: YES = 1 , NO = 2"))
					if povt == 1:
						if money - 35000 < 0:
							print("Sorry you don't have a money((")
							break
						else:
							money -= 35000
							print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
			####################################################################################
			if notebook == 2:
				hp = int(input("Buy = 1 , Show characters = 2"))
				if hp ==  1:
					if money - 30000 < 0:
						print("Sorry you don't have a money((")
						break
					else:
						money -= 30000
						print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
				else:
					print("Color: Black","\n","RAM:8gb","\n","ROM:1TB","\n","VideoCard:AMD HD Graphics8100")
					povt = int(input("Do you want to buy it?: YES = 1 , NO = 2"))
					if povt == 1:
						if money - 30000 < 0:
							print("Sorry you don't have a money((")
							break
						else:
							money -= 30000
							print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
			######################################################################################
			if notebook == 3:
				fujit = int(input("Buy = 1 , Show characters = 2"))
				if fujit == 1:
					if money - 20000 < 0:
						print("Sorry you don't have a money((")
						break
					else:
						money -= 20000
						print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
				else:
					print("Color: Black","\n","RAM:4gb","\n","ROM:500GB","\n","VideoCard:IntelHD graphics3500")
					povt = int(input("Do you want to buy it?: YES = 1 , NO = 2"))
					if povt == 1:
						if money - 20000 < 0:
							print("Sorry you don't have a money((")
							break
						else:
							money -= 20000
							print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
				
		if mag1 == 2:
			pc = int(input("1) DELL = 100000 , 2)ASUS = 60000 , 3)Apple = 500000 , 4)Lenovo = 300000"))
			############################################################################################
			if pc == 1:
				pc = int(input("Buy = 1 , Show characters = 2"))
				if pc ==  1:
					if money - 100000 < 0:
						print("Sorry you don't have a money((")
						break
					else:
						money -= 100000
						print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
				else:
					print("Color: black","\n","RAM:32gb","\n","ROM:2TB","\n","VideoCard:Nvidia Geforce GTX 1070TI")
					povt = int(input("Do you want to buy it?: YES = 1 , NO = 2"))
					if povt == 1:
						if money - 100000 < 0:
							print("Sorry you don't have a money((")
							break
						else:
							money -= 100000
							print("Tranzation succesfull, you have %.1f rub in your wallet"%money)
"""
"""
n=int(input())
while n>5:
    n = n - 4
    s=n%2
    n=(n-s)/2
if n==1:
	print('Sheldon')
if n==2:
	print('Leonard')
if n==3:
	print('Penny') 
if n==4:
	print('Rajesh')
if n==5:print('Howard')
"""

"""
n,l,a=map(int,input().split())
ans=0
if n>0:
    lt,ltt=0,0
    
    for i in range(n):
        t,tt=map(int,input().split())
        ans+=(t-(lt+ltt))//a
        lt,ltt=t,tt
    ans+=(l-(lt+ltt))//a
else:
    ans+=l//a

print(ans)
"""
"""
tc=int(input())
for i in range(tc):
    s,a,b,c=map(int,input().split())
    d=s//c
    p=d//a
    p=p*b
    print(p+d)
"""
"""
n,k,l,c,d,p,nl,np = map(int,input().split())
ml = k * l
tost = ml // nl
lim = c * d
nam = p / np
print(int(min(tost,lim,nam)/n))
"""
"""
n,d = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
a.reverse()
ans = 0
for i in range(n//2):
	if a[i] - a[i+1] <= d:
			ans += 1
print(ans,a)
"""
n,m = map(int, input().split())
s = list(map(str,input()))
for i in range(m):
	l, r, c1, c2 =input().split()
	l = int(l)
	r = int(r)
	for i in range(l-1, r):
		if s[i] == c1:
			s[i] = c2
print(*s, sep='')
