The first line contains an integer $1 \le n \le 10^5$, the number of strings in $A$.
Then, $n$ lines follow, where the $i$-th line corresponds to the $i$-th string in $A$.
Then, $q$ lines follow, each having a query in the format described above.
The sum of the lengths of the strings present in array $A$ and in all queries does not exceed $5 \cdot 10^5$.