n,q,_,s=io.read("*n","*n","*l","*l") t={} for i=1,26 do t[i]={0} end for i=1,n do for j=1,26 do if s:byte(i)-96==j then t[j][i+1]=t[j][i]+1 else t[j][i+1]=t[j][i] end end end for w=1,q do l,r,x=io.read("*n","*n","*n") for i=1,26 do z = t[i][r+1]-t[i][l] if x<=z then print(string.char(96+i)) break end x=x-z end end