import collections N,Q=map(int,input().split()) S=input() cumsum = [None for i in range(len(S)+1)] cumsum[0] = [0]*26 chidx = [0]*26 for i,s in enumerate(S, 1): chidx[ord(s) - ord('a')] += 1 cumsum[i] = [a for a in chidx] #print(chidx) deq = collections.deque() for q in range(Q): l,r,x=map(int,input().split()) #print("debu", l, r, x) diff = [ri-li for ri,li in zip(cumsum[r], cumsum[l-1])] tmp = 0 for i, d in enumerate(diff, ord('a')): tmp += d if tmp >= x: deq.append(chr(i)) break print(*deq,sep='\n')