class BIT: def __init__(self, n): self.n = n self.data = [0]*(n+1) def to_sum(self, i): s = 0 while i > 0: s += self.data[i] i -= (i & -i) return s def add(self, i, x): while i <= self.n: self.data[i] += x i += (i & -i) def get(self, i, j): return self.to_sum(j)-self.to_sum(i-1) N,Q = map(int,input().split()) S = str(input()) SL = [] for i in range(N): SL.append(ord(S[i])-96) #1index #print(SL) for i in range(Q): l,r,x = map(int,input().split()) l-=1;r-=1 Tree = BIT(28) for j in range(l,r+1): num = SL[j] Tree.add(num,1) if Tree.get(1,1) >= x: print("a") continue ok = 28 ng = 1 while abs(ok-ng) > 1: mid = (ok+ng)//2 if Tree.get(1,mid) >= x: ok = mid else: ng = mid #print(ok) ans = chr(ok+96) print(ans)