n, q = map(int, input().split()) s = input() counts = [[0]*26 for i in range(n+1)] for i in range(1, n+1): counts[i][ord(s[i-1])-ord("a")] += 1 for j in range(26): counts[i][j] += counts[i-1][j] for _ in range(q): l, r, x = map(int, input().split()) lcount = counts[l-1] rcount = counts[r] for i in range(26): if x > (rcount[i] - lcount[i]): x -= (rcount[i] - lcount[i]) else: print(chr(ord("a")+i)) break