n, q = map(int, input().split())
s = input()
st = []
for i in reversed(range(n)):
st.append((i, s[i]))
for j in range(q):
vals = input().split()
t = int(vals[0])
i = int(vals[1])
i -= 1
if t == 1:
val = vals[2]
while len(st) > 0 and st[-1][0] <= i:
st.pop()
st.append((i, val))
else:
l = 0
r = len(st)
while r - l > 1:
m = (l + r) // 2
if st[m][0] >= i:
l = m
else:
r = m
print(st[l][1])