You are given a string S of length N and Q queries.
The queries are of 3 types :
Input format
Output format
Print the answer for each query of type 2 and 3.
Constraints
For query 1, the suffix of length 1 ending at index 3 and 5 is the maximum length of the prefix that matches.
For query 3, only one substring matches with S[5, 6] matches with S[1, 2].