from collections import Counter, deque from copy import copy N,Q = map(int,input().split()) S = list(str(input())) alp = list('abcdefghijklmnopqrstuvwxyz') s = Counter(sorted(S)) C = deque([copy(s)]) for i in range(N-1,-1,-1): s[S[i]] -= 1 C.appendleft(copy(s)) for _ in range(Q): l,r,x = map(int,input().split()) a,b = C[l-1],C[r] count = 0 for p in alp: count += b[p]-a[p] if count >= x: print(p) break