📅  最后修改于: 2022-03-11 14:45:07.490000             🧑  作者: Mango
n = int(input())
output = []
strings = []
for _ in range(n):
strings.append(input().strip())
q = int(input())
for _ in range(q):
L,R,K = map(int, input().split())
s = ""
for __ in range(L-1,R):
s += strings[__]
output.append(s[K-1])
print(*sorted(output),sep='\n')