#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for(ll i=0; i < (n); i++) #define rrep(i, n) for(ll i=(n)-1; i >=0; i--) #define ALL(v) v.begin(),v.end() #define rALL(v) v.rbegin(),v.rend() #define FOR(i, j, k) for(ll i=j;i llvec; typedef vector dvec; typedef pair P; typedef long double ld; struct edge{ll x, c;}; /************************************** ** A main function starts from here ** ***************************************/ int main(){ ll N, Q; string S; cin >> N >> Q; cin >> S; vector loc(26); rep(i, N){ loc[S[i]-'a'].push_back(i+1); } while(Q--){ ll l, r, x; cin >> l >> r >> x; ll cnt = 0; rep(k, 26){ cnt += upper_bound(ALL(loc[k]), r) - lower_bound(ALL(loc[k]), l); if(cnt>=x){ cout << (char)('a'+k)<