String Test
View as PDFGiven two strings  and 
, support the following four operations:
Set the
th character of
to
and then output
.
Consider the 1-indexed substring of
starting at index
ending at index
, call it
. Print
.
Consider the suffixes of
starting with the
th and
th indexed characters, call them
and
. Print
.
Consider the 1-indexed substrings of
starting and ending at
and
, and
and
. Determine if their concatenation is a substring of
. Print
yesif so, printnootherwise.
 is the length of the longest common prefix of 
 and 
.
 is a pair 
 where 
 is the maximum value of 
 where 
 varies over all suffixes of 
, and 
 is the number of suffixes that yield that maximum value.
Constraints
Each character in the string will be a positive integer no larger than .
Input
The first line contains a single integer, the test case number. You may ignore this line.
The next line contains a single positive integer, , representing the length of 
.
The next line contains  space-separated integers, the string 
.
The next line contains a single positive integer, , representing the length of 
.
The next line contains  space-separated integers, the string 
.
The next line contains a single positive integer, , representing the number of operations.
The next  lines indicate the operations to be performed in order.
If the operation is the first one, there will be three space-separated integers, , 
, and 
.
If the operation is the second one, there will be three space-separated integers, , 
, and 
.
If the operation is the third one, there will be three space-separated integers, , 
, and 
.
If the operation is the fourth one, there will be five space-separated integers, , 
, 
, 
, and 
.
Output
Print an answer for each operation. All answers go on their own lines.
Sample Input
0
10
1 2 3 3 3 1 2 3 2 1
3
1 3 1
10
3 1 3
4 3 3 2 2
2 2 10
1 3 2
2 7 9
2 7 10
2 3 9
2 2 8
1 7 1
1 4 2
Sample Output
1
yes
1 2
1 3
0 3
1 1
1 1
1 1
2 1
2 1
Comments