String insertion

Implement an efficient data structure to keep a dynamic array A[0..] of strings, with two operations:

Input

Input consists of just one case. Assume that each ss has between 1 and 10 lowercase letters, each ii is between 0 and the current number of strings, and each jj is between 0 and the current number of characters minus one. The total number of operations is at most 31053 \cdot 10^5. An ‘E’ marks the end of the input.

Output

Print a line with the letter at the jj-th position for each ‘C’ operation.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T10:11:01.791Z

© Jutge.org, 2006–2026.
https://jutge.org