{"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":"MD","content":"Cho một chuỗi s chỉ gồm các kí tự từ \u0027a\u0027 đến \u0027z\u0027 và q truy vấn\nLưu ý ở bài này chuỗi con là chuỗi con liên tiếp.\nVí dụ: các chuỗi con của \"codeforces\" là \"code\", \"force\", \"f\", \"for\", chứ không phải \"coder\" và \"top\".\n\n Có hai loại truy vấn:\n\n - Loại 1: 1 pos c(1≤pos≤∣s∣, c là chữ Latinh viết thường): thay thế kí tự tại pos bằng kí tự c (s[pos]\u003dc);\n - Loại 2: 2 l r(1≤l≤r≤∣s∣): tính số ký tự phân biệt trong xâu con s[l;r]\n\n"}},{"title":"Input","value":{"format":"MD","content":"- Dòng đầu tiên chứa một chuỗi s bao gồm không quá 10^5 chữ cái Latinh viết thường.\n\n- Dòng thứ hai của input chứa một số nguyên q (1≤q≤10^5) — số lượng truy vấn.\n\n- q dòng tiếp theo chứa các truy vấn, mỗi truy vấn một dòng. Mỗi truy vấn được đưa ra theo định dạng được mô tả trong đề bài. Đảm bảo rằng có ít nhất một truy vấn thuộc loại thứ hai.\n\n"}},{"title":"Output","value":{"format":"MD","content":"Đối với mỗi truy vấn trong loại thứ 2 thì in ra kết quả của truy vấn đó trên một dòng."}},{"title":"Sample 1","value":{"format":"MD","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":"MD","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"}}]}