import sys input = sys.stdin.readline N, Q = map(int, input().split()) S = list(map(lambda c: ord(c) - ord("a"), list(input())[: -1])) cs = [[0] * (N + 1) for _ in range(26)] for i in range(26): for j in range(N): cs[i][j + 1] = cs[i][j] + (S[j] == i) for _ in range(Q): l, r, x = map(int, input().split()) for i in range(26): c = cs[i][r] - cs[i][l - 1] x -= c if x <= 0: print(chr(i + ord("a"))) break