You have an initial string $$$S$$$, and $$$q$$$ operations will be performed sequentially. There are three types of operations:
After all operations are completed, you need to answer: what is the $$$P$$$-th character of the final string? The indices start from $$$1$$$. It is guaranteed that $$$P$$$ does not exceed the length of the final string.
The first line contains a positive integer $$$T$$$ $$$(1 \le T \le 10^5)$$$, denoting the number of test cases.
For each test case:
Guarantees: The sum of $$$|S|$$$ across all test cases does not exceed $$$2 \times 10^5$$$, and the sum of $$$q$$$ across all test cases does not exceed $$$2 \times 10^5$$$. For each test case, the length of the string after all operations is at least $$$P$$$.
For each test case, output a single character on a line, which is the $$$P$$$-th character of the final string.
1ab31 c32 14
a
| Название |
|---|


