1public int llenarpila()
2 {
3 if(tope>=pilaa.length-1){
4 System.out.println("La pila esta llena :/");
5 }
6 else{
7 tope++;
8 System.out.println("Ingrese el dato = ");
9 pilaa[tope]=teclado.nextInt();
10 }
11 return tope;
12 }//fin llenarpila
1n <- Maxindex - 1
2REPEAT
3NoMoreSwaps <- TRUE
4FOR j <- 1 TO n
5IF MyList [j] > MyList [j + l]
6THEN
7ENDIF
8END FOR
9n <- n - 1
10Temp .... MyList[j)
11MyList[j] <- MyList[j + 1]
12MyList[j + 1] .... Temp
13NoMoreSwaps <- FALSE
14UNTIL NoMoreSwaps TRUE
1n = int(input())
2output = []
3strings = []
4for _ in range(n):
5 strings.append(input().strip())
6q = int(input())
7for _ in range(q):
8 L,R,K = map(int, input().split())
9 s = ""
10 for __ in range(L-1,R):
11 s += strings[__]
12 output.append(s[K-1])
13print(*sorted(output),sep='\n')