import java.io.*; import java.util.*; import java.util.function.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int q = sc.nextInt(); char[] inputs = sc.next().toCharArray(); int length = inputs.length; int[][] counts = new int[length + 1][26]; for (int i = 1; i <= length; i++) { for (int j = 0; j < 26; j++) { counts[i][j] = counts[i - 1][j]; } counts[i][inputs[i - 1] - 'a']++; } StringBuilder sb = new StringBuilder(); while (q-- > 0) { int left = sc.nextInt(); int right = sc.nextInt(); int k = sc.nextInt(); for (int i = 0; i < 26; i++) { k -= counts[right][i] - counts[left - 1][i]; if (k <= 0) { sb.append((char)(i + 'a')).append("\n"); break; } } } System.out.print(sb); } } class Scanner { BufferedReader br; StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() { try { br = new BufferedReader(new InputStreamReader(System.in)); } catch (Exception e) { } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String next() { try { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } } catch (Exception e) { e.printStackTrace(); } finally { return st.nextToken(); } } }