n, q = map(int, input().split()) S = input() DP = [[0 for _ in range(26)] for _ in range(n + 1)] for i in range(n): idx = ord(S[i]) - ord('a') for j in range(26): if j == idx: DP[i + 1][j] = DP[i][j] + 1 else: DP[i + 1][j] = DP[i][j] for _ in range(q): l, r, x = map(int, input().split()) l -= 1 cnt = 0 for i in range(26): temp = DP[r][i] - DP[l][i] if cnt + temp >= x: print(chr(ord('a') + i)) break cnt += temp