# alphabet count tableを用意するか alphabets = 'abcdefghijklmnopqrstuvwxyz' dic = {} for i in range(26): dic[alphabets[i]] = i N, Q = map(int, input().split()) S = input() dp = [[0]*26 for i in range(N+1)] for i in range(1, N+1): letter_num = dic[S[i-1]] for j in range(26): dp[i][j] = dp[i-1][j] dp[i][letter_num] += 1 #print(dp[i]) for q in range(Q): l, r, x = map(int, input().split()) count = [0]*26 for i in range(26): count[i] = dp[r][i]-dp[l-1][i] x_remainder = x for i in range(26): if count[i] < x_remainder: x_remainder -= count[i] elif count[i] >= x_remainder: #print(count) print(alphabets[i]) break