class INPUT: def __init__(self): self.l=open(0).read().split()[::-1] self.length=len(self.l) return def stream(self,k=1,f=int,f2=False): assert(-1 return left all listを変数で受け取るとき、必ずlistをTrueにすること。 """ from sys import stderr from copy import copy we=stderr.write def main(): N,Q=pin(2) S=list(pin(1,str)) d=[] a=[0]*26 d.append(copy(a)) for i in S: a[ord(i)-97]+=1 d.append(copy(a)) for _ in [0]*Q: L,R,X=pin(3) #print(d[R],d[L-1]) db=[] for i in range(26): t=d[R][i]-d[L-1][i] db.append(t) X-=t if X<=0: print(chr(97+i)) break return main()