Problem: Given a string s, process q queries, each having one of the following forms:

  * 1 i c — Change the i-th character in the string to c. 
  * 2 l r y — Consider the substring of s starting at position l and ending at position r. Output the number of times y occurs as a substring in it. 

Input

The first line of the input contains the string s (1 ≤ |s| ≤ 105) of lowercase English letters.

The second line contains an integer q (1 ≤ q ≤ 105) — the number of queries to process.

The next q lines describe the queries and may have one of the following forms:

  * 1 i c (1 ≤ i ≤ |s|) 
  * 2 l r y (1 ≤ l ≤ r ≤ |s|) 



c is a lowercase English letter and y is a non-empty string consisting of only lowercase English letters.

The sum of |y| over all queries of second type is at most 105.

It is guaranteed that there is at least one query of second type.

All strings are 1-indexed.

|s| is the length of the string s.

Output

For each query of type 2, output the required answer in a separate line.

Examples

Input

ababababa
3
2 1 7 aba
1 5 c
2 1 7 aba


Output

3
1


Input

abcdcbc
5
2 1 7 bc
1 4 b
2 4 7 bc
1 2 a
2 1 4 aa


Output

2
2
1

Note

Consider the first sample case. Initially, the string aba occurs 3 times in the range [1, 7]. Note that two occurrences may overlap. 

After the update, the string becomes ababcbaba and now aba occurs only once in the range [1, 7].

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &a) {
  T x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = 0;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + (ch ^ '0');
    ch = getchar();
  }
  a = f ? x : -x;
}
char s[1000010], t[1000010];
int q, opt, ls, lt, l, r;
bitset<100010> n[26];
bitset<100010> ans;
signed main() {
  scanf("%s", s);
  read(q);
  ls = strlen(s);
  for (int i = 0; i < ls; i++) {
    n[s[i] - 'a'][i] = 1;
  }
  while (q--) {
    read(opt);
    if (opt == 1) {
      int pos;
      read(pos);
      pos--;
      char ch = getchar();
      n[s[pos] - 'a'][pos] = 0;
      s[pos] = ch;
      n[s[pos] - 'a'][pos] = 1;
    } else {
      read(l), read(r);
      scanf("%s", t);
      l--;
      lt = strlen(t);
      ans.set();
      for (int i = 0; i < lt; i++) {
        ans &= (n[t[i] - 'a'] << lt - i - 1);
      }
      printf("%d\n",
             max(0, int((ans >> l + lt - 1).count() - (ans >> r).count())));
    }
  }
}