You are given a string S of length N consisting of only lower case English alphabets. You will need to answer Q queries of the following types.
Input format
Output format
For each query of type 1:
Constraints
1≤N≤105
1≤L≤R≤N
|W|≤min(R−L+1,10)
|U|=R−L+1
∑Qi=1|W|≤106
∑Qi=1|U|≤105
In first query we have to find no of occurrences of string "ana" in substring "anananb" which is 2
In second query the string becomes "nananana"
In last query we have to find no of occurrences of string "ana" in substring "ananana" which is now 3