""" """ import sys from sys import stdin alp = "abcdefghijklmnopqrstuvwxyz" def bitadd(a,w,bit): #aにwを加える(1-origin) a += 1 x = a while x <= (len(bit)-1): bit[x] += w x += x & (-1 * x) def bitsum(a,bit): #ind 1~aまでの和を求める a += 1 ret = 0 x = a while x > 0: ret += bit[x] x -= x & (-1 * x) return ret ans = [] N,Q = map(int,stdin.readline().split()) S = stdin.readline()[:-1] b = [[0] * (N+5) for i in range(26)] for i in range(1,N+1): c = ord(S[i-1])-ord('a') bitadd(i,1,b[c]) for loop in range(Q): L,R,X = map(int,stdin.readline().split()) for i in range(26): X -= bitsum(R,b[i]) - bitsum(L-1,b[i]) if X <= 0: ans.append(alp[i]) break print ("\n".join(ans))