N, Q = map(int, input().split()) S = input() alpha =['a','b','c','d','e','f','g','h','i','j','k','l','m','n', 'o','p','q','r','s','t','u','v','w','x','y','z'] data = [[[0] for k in range(26)] for _ in range(N)] for i in range(N): for k in range(26): data[i][k] = S.count(alpha[k], 0, i+1) a = [0]*26 for i in range(Q): l, r, x = list(map(int, input().split())) if l > 1: DATA = data[l-2] else: DATA = a d = data[r-1][0] - DATA[0] for j in range(26): if d >= x: print(alpha[j]) break d += data[r-1][j+1] - DATA[j+1]