{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"给定一个字符串 $s$ ,然后进行 $q$ 次操作,操作 $1$ 将第 $pos$ 个字符改成 $c$ ,操作 $2$ 查询 $[l, r]$ 中不同字符的数量。\n\u003cp\u003eYou are given a string $$$s$$$ consisting of lowercase Latin letters and $$$q$$$ queries for this string.\u003c/p\u003e\n\u003cp\u003eRecall that the substring $$$s[l; r]$$$ of the string $$$s$$$ is the string $$$s_l s_{l + 1} \\dots s_r$$$. For example, the substrings of \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecodeforces\u003c/span\u003e\" are \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecode\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eforce\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ef\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003efor\u003c/span\u003e\", but not \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecoder\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003etop\u003c/span\u003e\".\u003c/p\u003e\n\u003cp\u003eThere are two types of queries: \u003c/p\u003e\n\u003cul\u003e \n \u003cli\u003e $$$1~ pos~ c$$$ ($$$1 \\le pos \\le |s|$$$, $$$c$$$ is lowercase Latin letter): replace $$$s_{pos}$$$ with $$$c$$$ (set $$$s_{pos} :\u003d c$$$); \u003c/li\u003e\n \u003cli\u003e $$$2~ l~ r$$$ ($$$1 \\le l \\le r \\le |s|$$$): calculate the number of distinct characters in the substring $$$s[l; r]$$$. \u003c/li\u003e\n\u003c/ul\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains one string $$$s$$$ consisting of no more than $$$10^5$$$ lowercase Latin letters.\u003c/p\u003e\n\u003cp\u003eThe second line of the input contains one integer $$$q$$$ ($$$1 \\le q \\le 10^5$$$) — the number of queries.\u003c/p\u003e\n\u003cp\u003eThe next $$$q$$$ lines contain queries, one per line. Each query is given in the format described in the problem statement. It is guaranteed that there is at least one query of the second type.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each query of the second type print the answer for it — the number of distinct characters in the required substring in this query.\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003eabacaba\n5\n2 1 4\n1 4 b\n1 5 b\n2 4 6\n2 1 7\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n1\n2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003edfcbbcfeeedbaea\n15\n1 6 e\n1 4 b\n2 6 14\n1 7 b\n1 12 c\n2 6 8\n2 1 6\n1 7 c\n1 2 f\n1 10 a\n2 7 9\n1 10 a\n1 14 b\n1 1 f\n2 1 11\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n2\n5\n2\n6\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}