You are given a string s consisting of lowercase Latin letters and q
queries for this string.
Recall that the substring s[l;r]
of the string s is the string slsl+1…sr
. For example, the substrings of "codeforces" are "code", "force", "f", "for", but not "coder" and "top".
There are two types of queries:
- 1 pos c
(1≤pos≤|s|, c is lowercase Latin letter): replace spos with c (set spos:=c
- );
- 2 l r
(1≤l≤r≤|s|): calculate the number of distinct characters in the substring s[l;r]
Input
The first line of the input contains one string s
consisting of no more than 105
lowercase Latin letters.
The second line of the input contains one integer q
(1≤q≤105
) — the number of queries.
The next q
lines contain queries, one per line. Each query is given in the format