import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int q = sc.nextInt(); int[][] sums = new int[n + 1][]; sums[0] = new int[26]; char[] arr = sc.next().toCharArray(); for (int i =1; i <= n; i++) { sums[i] = (int[])(sums[i - 1].clone()); sums[i][arr[i - 1] - 'a']++; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < q; i++) { int left = sc.nextInt() - 1; int right = sc.nextInt(); int x = sc.nextInt(); for (int j = 0; j < 26; j++) { x -= sums[right][j] - sums[left][j]; if (x <= 0) { sb.append((char)(j + 'a')).append("\n"); break; } } } System.out.print(sb); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }