string-query-22_9754
Given a string s and m queries. For each query delete the K-th occurence of a character x.

Input:
The first line contains the string s followed by an integer m.
The string consists of lowercase letters.
After that m lines follow each line containing the integer K and the character x.

Output:
Print the string after all the m queries.

Constraints:
1 ≤ string length ≤2*10^5
1 ≤ m ≤ 40000

Note: 
It is guaranteed that the operations are correct, that is , the letter to be deleted always exists and the string is never empty.

SAMPLE INPUT
abcdbcaab
5
2 a
1 c
1 d
3 b
2 a

SAMPLE OUTPUT
abbc

Explanation

After query 1: 
abcdbcab

After query 2:
abdbcab

After query 3:
abbcab

After query 4:
abbca 

After query 5:
abbc
s = raw_input()
s = list(s)
ln = len(s)
di = {}
ind = 0
for i in s:
	if i in di:
		t = di[i]
		t.append(ind)
		di[i] = t
	else:
		di[i] = [ind]		
	ind+=1
#print di
m = input()
while m:
	m-=1
	k,x = raw_input().split()
	k = int(k)
	k -= 1
	t = di[x]
	t.pop(k)
	di[x] = t
temp = '$'*ln
temp = list(temp)
for i in di:
	t = di[i]
	for j in t:
		temp[j]=i
m=''
for i in range(ln):
	if temp[i] != '$':
		m = m + temp[i]
print m
abcdbcaab
5
2 a
1 c
1 d
3 b
2 a

SAMPLE abcdbcaab
5
2 a
1 c
1 c
3 b
2 a

SAMPLE abcdbcaab
0
2 a
1 c
1 d
5 b
2 a

SAMPLE abcdbcaab
5
2 a
1 c
1 c
1 b
2 a

SAMPLE abcdbcaab
1
2 a
1 c
1 d
5 b
2 a

SAMPLE abcdbcaab
5
2 a
1 c
1 c
1 b
1 a

ELPMAS abcdbcaab
5
2 a
1 c
1 b
2 b
2 a

SAMPLE baacbdcba
1
2 a
1 c
1 d
5 b
2 b

SAMPLF accdbcaab
1
2 a
1 c
0 d
2 b
4 `

S@MPLE baacbdcba
2
2 a
2 c
1 e
1 b
2 c

SANPLF baacbdcba
2
2 a
1 c
1 e
1 b
2 c

SANPLF bbacbdcba
2
2 a
1 c
1 e
1 b
0 c

SFNPLA abcdbcaab
5
2 a
1 c
1 c
3 b
1 a

SAMPLE abcdbcaab
5
2 a
1 c
1 b
1 b
1 a

ELPMAS abcdbcaab
5
1 a
1 c
1 c
1 b
1 b

ELPMAS baacbdcba
1
3 a
2 c
1 d
5 b
2 c

SANPLF baacbecba
2
2 a
1 c
1 e
1 b
0 c

SFNPLA abcdbcaab
5
2 b
1 c
1 c
1 b
2 a

SAMPLF abcdbcaab
5
2 a
1 c
1 c
1 b
2 b

ELOMAS baacbdcba
0
2 a
1 c
1 d
5 a
2 b

SAMPLF abcdbcaab
1
3 b
1 c
1 d
0 b
2 a

SAMPLE baacbdcba
1
2 b
0 c
1 d
5 b
2 c

SANPLF abcdbcaab
1
1 a
1 c
0 d
4 c
4 _

SLMPAE baacadcba
1
2 a
3 b
1 d
5 b
2 b

SANPLF aaacbdcba
1
3 a
0 c
1 d
5 b
2 c

SANPLF bbacbccba
2
2 a
1 c
1 c
1 b
0 c

SFNPLA abcdacabb
0
2 a
1 c
2 e
5 b
2 a

SAMPLE abcdbcaab
1
1 b
1 c
1 d
0 b
2 a

SAMPLE bbacbccba
2
2 a
1 b
1 c
1 b
0 c

SFNPLA abcdccaab
1
2 a
1 c
0 d
1 c
0 b

SAMPKE caacadcba
1
2 a
3 b
1 d
5 b
3 b

SANPLF caacadbba
1
2 a
3 b
1 d
5 b
3 b

SANPLF bbacbccba
0
2 a
1 b
1 d
1 b
0 c

SFNPLA abccbcaab
0
2 a
1 b
1 c
5 b
3 c

SMAPLF dbcabcaab
1
3 a
1 c
-1 d
7 d
4 a

SAMPLE baadbdcba
1
2 b
2 e
1 e
1 c
1 c

SANPLF baacbdcba
2
2 b
1 c
1 f
-1 c
3 c

FLPMAS caacadbba
1
4 a
0 b
1 d
5 b
3 b

SANFLP abcabcdab
1
3 a
1 c
-1 e
7 d
7 a

SAMPLE babcaddba
2
2 b
1 c
1 f
-1 c
6 c

FLPMAS abbdacaac
1
4 a
0 c
1 c
5 c
3 b

SANFLP baacbcdba
1
2 a
1 c
-1 e
10 b
0 b

S@EPLM bbacbccba
1
2 a
1 b
2 c
-1 b
1 b

SFNPLA babcadcba
2
1 b
1 c
1 f
-1 c
1 c

FLPMAS bbacadcba
0
2 a
0 c
-2 e
1 b
1 a

ELPLAS badcbacba
1
3 a
1 c
0 e
7 e
7 a

SBMPLE baacbcdba
2
2 a
1 c
-2 e
10 b
0 b

S@EPLM abcdacbab
2
2 b
1 c
1 f
-1 c
1 c

FMPLAS babcadcba
0
2 a
0 c
-2 e
1 b
0 a

ELPLAS abcdacbab
1
2 b
1 c
1 f
-1 c
1 c

FMPLAS acbdacbab
1
2 b
1 c
1 f
-1 c
1 c

FMPLAS acbdacbab
1
3 b
1 c
1 e
-1 c
1 c

FMPLAS abbcccaab
0
4 a
0 c
0 c
22 a
0 b

LSAOKF abbcccabb
0
4 a
1 c
0 c
22 a
-1 b

FKOASL aadcbacba
1
3 a
0 d
0 e
-1 e
4 a

ELPMBS aabcbdcba
0
0 a
0 c
0 d
1 a
1 b

LLEPAS aadcbacba
1
4 a
0 c
0 e
-1 e
4 `

SBMPLE aadcbacba
0
4 a
0 c
0 e
-1 e
4 `

SBMPLE aabcbdcba
1
1 a
0 c
1 d
1 a
1 c

SLLFAP abcbbcaad
0
2 a
1 c
1 d
5 b
2 a

SAMPLE abcdbcaab
1
2 b
1 c
1 d
5 b
2 b

SAMPLE bbacbdcba
2
2 a
1 d
1 d
1 b
0 c

SFNPLA bbcdbcaab
5
2 a
1 c
1 c
1 b
1 a

ELPMAS bbacbdcba
1
2 a
1 c
1 d
1 b
0 c

SFNPLA abcdbcaab
5
2 b
1 c
1 c
1 a
2 a

SAMPLF baaabdcbc
2
2 a
1 c
1 e
2 b
2 c

SFNOLA daacbbcba
0
2 a
1 c
1 d
5 `
2 b

SAMPLF abcdbcaab
2
2 a
1 c
0 d
1 c
4 b

SAMPKE baacbdcba
2
2 a
1 d
1 f
0 b
2 c

SAMPLF abccbcabb
2
2 a
1 c
1 c
1 b
0 c

SFNPLA baacbdabc
2
2 a
1 c
1 f
-1 b
2 c

SAMPLF caaacdcba
1
2 a
3 b
1 d
5 b
3 b

SANPLF baaccdcba
1
2 a
1 c
1 d
1 c
0 b

SAMPKE accdbcaab
0
2 a
1 c
0 c
2 b
3 `

ELPM@S cbccbaaab
0
2 a
1 b
1 c
5 b
3 c

SMAPLF abcbbcaad
1
3 a
1 c
-1 d
7 d
4 a

SAMPLE abccbcaab
1
2 a
1 b
1 c
9 b
3 c

SLAPKF abcabcdab
1
3 b
1 c
-1 e
7 d
7 a

SBMPLE abccccaab
0
2 a
0 b
0 c
9 b
3 c

SLAOKF abccbbaab
0
2 a
0 c
0 c
9 b
3 c

SLAOKF baacbcdba
1
3 a
1 c
-2 e
10 b
0 b

S@EPLM bbacbccba
1
2 b
1 b
2 c
-1 b
1 c

SFNPLA badcbacba
1
2 a
-1 d
0 e
-1 e
4 a

ELPMBS adacbacba
1
3 a
0 d
0 e
-1 e
4 `

ELPMBS bbacccbba
0
4 `
0 c
1 d
22 a
-1 c

LTAOKF abdcaacba
0
8 a
1 c
0 f
-2 e
8 `

SBMPLE abcebcaab
1
2 b
1 c
1 d
5 b
2 b

SAMPLE baacbddba
2
2 a
1 c
0 e
1 b
2 c

SFNPLA baacbdcba
2
2 a
1 b
1 d
1 b
0 c

SFNPLA abddbcaab
1
2 a
1 c
1 c
5 b
2 b

PAMSLF abcdbcaab
2
2 a
2 c
0 d
2 b
4 `

S@EPLM bccdbcaab
1
2 a
1 c
0 e
2 b
2 `

S@MPLE baacbecba
2
2 a
2 c
1 e
0 b
0 c

SFNPLA abcdbcaab
5
2 b
1 c
1 d
1 a
2 a

SAMPLF abadbcacb
1
3 a
1 c
1 d
0 b
2 a

ELPMAS abcdcbaab
1
2 a
0 c
0 d
4 c
7 a

SAMPLE baaabdcbc
2
2 a
2 c
1 e
2 b
2 c

SFNOLA daaccbcba
0
2 a
1 c
1 d
5 `
2 b

SAMPLF baacbdabc
1
2 a
2 d
2 e
1 a
4 c

SANPLF bbacbccba
2
2 a
1 a
1 b
1 b
0 c

SFNPLA abcdccaab
0
2 a
1 d
0 d
1 c
0 b

SAMPKE
abbc
 abdb
 abcdbcaab
 adbb
 abcdbcab
 dbab
 adbc
 bacbdcba
 accdbcab
 bacbdba
 babdcba
 bbabdcb
 bdba
 dcab
 daab
 baacbdcb
 babecba
 adab
 adba
 baacbdcba
 abcdbcaa
 baacdcba
 bcdbcaab
 bacadcba
 aacbdcba
 bbabccb
 abcdacabb
 acdbcaab
 bacbccb
 abcdccab
 cacadcba
 cacadbba
 bbacbccba
 abccbcaab
 dbcabcab
 baaddcba
 baadcba
 caacadbb
 abcabcdb
 baaddba
 abbdacac
 bacbcdba
 bbacbccb
 abadcba
 bbacadcba
 badcbacb
 babcdba
 abdacab
 babcadcba
 abcdacab
 acbdacab
 acbdacba
 abbcccaab
 abbcccabb
 aadcbcba
 aabcbdcba
 aadcbacb
 aadcbacba
 abcbdcba
 abcbbcaad
 abcdcaab
 bbacbcb
 bdbb
 bbacbdcb
 bdab
 baabdbc
 daacbbcba
 abdbcab
 bacbcba
 abcbcbb
 babdabc
 caacdcba
 baccdcba
 accdbcaab
 cbccbaaab
 abcbbcad
 abccbcab
 abcabcda
 abccccaab
 abccbbaab
 baacbcdb
 bacbccba
 badcbcba
 adacbcba
 bbacccbba
 abdcaacba
 abcecaab
 babddba
 acbdcba
 abddbcab
 abcdbab
 bccdbcab
 bacbeba
 bcab
 abadbccb
 abcdcbab
 baabdcb
 daaccbcba
 bacbdabc
 bbcbccb
 abcdccaab
