abcdabcdab
5
2 2 8 ab
2 1 10 ab
1 3 a
1 4 b
2 1 4 ab

1
3
2

#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
bitset<N> bt[26], ans;
int n, x, y, opt;
char s[N], c[N];
int main() {
  scanf("%s", s + 1);
  for (int i = 1; s[i]; ++i) bt[s[i] - 'a'][i] = 1;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &opt);
    if (opt == 1) {
      scanf("%d%s", &x, c);
      bt[s[x] - 'a'][x] = 0;
      s[x] = c[0];
      bt[s[x] - 'a'][x] = 1;
    } else {
      scanf("%d%d%s", &x, &y, c);
      y = y - strlen(c) + 2;
      if (x >= y) {
        puts("0");
        continue;
      }
      printf("%d %d\n", x, y);
      ans = bt[c[0] - 'a'];
      for (int i = 1; c[i]; ++i) ans &= bt[c[i] - 'a'] >> i;
      printf("%d\n", (ans >> x).count() - (ans >> y).count());
    }
  }
  return 0;
}
