Lucas really wanted to create an interesting problem with strings, but he spent so much time thinking that he ended up with no creativity to create a better statement for this problem.
The problem he came up with is the following:
Given an array v of strings, answer these queries:
In the first line of input, there is an integer n (1 ≤ n ≤ 105) indicating the size of the array v. The following n lines display the contents of the array, where the (i + 1)-th line is the string in the i-th position in the array.
In the (n + 2)-th line, there is an integer q (1 ≤ q ≤ 105), the number of queries to be executed. The following q lines contain the description of the q queries, one per line.
Each query is described as follows:
For each query of type 2 and 3, print "Y" if the query's answer is true or "N" if it's false.
3
aaa
ab
acc
10
2 1 3 abb
2 3 3 abb
2 1 1 aaa
3 1 3 a
3 1 3 ac
3 3 3 b
3 3 3 ac
3 1 3 e
1 1 eae
3 1 3 e
Y
N
Y
Y
Y
N
Y
N
Y
.