{"trustable":true,"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":"\u003cp\u003eYou want to perform the combo on your opponent in one popular fighting game. The combo is the string $$$s$$$ consisting of $$$n$$$ lowercase Latin letters. To perform the combo, you have to press all buttons in the order they appear in $$$s$$$. I.e. if $$$s\u003d$$$\"\u003cspan class\u003d\"tex-font-style-tt\"\u003eabca\u003c/span\u003e\" then you have to press \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027, then \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\u0027, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ec\u003c/span\u003e\u0027 and \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027 again.\u003c/p\u003e\u003cp\u003eYou know that you will spend $$$m$$$ wrong tries to perform the combo and during the $$$i$$$-th try you will make a mistake right after $$$p_i$$$-th button ($$$1 \\le p_i \u0026lt; n$$$) (i.e. you will press first $$$p_i$$$ buttons right and start performing the combo from the beginning). It is guaranteed that during the $$$m+1$$$-th try you press all buttons right and finally perform the combo.\u003c/p\u003e\u003cp\u003eI.e. if $$$s\u003d$$$\"\u003cspan class\u003d\"tex-font-style-tt\"\u003eabca\u003c/span\u003e\", $$$m\u003d2$$$ and $$$p \u003d [1, 3]$$$ then the sequence of pressed buttons will be \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027 (\u003cspan class\u003d\"tex-font-style-bf\"\u003ehere\u003c/span\u003e you\u0027re making a mistake and start performing the combo from the beginning), \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\u0027, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ec\u003c/span\u003e\u0027, (\u003cspan class\u003d\"tex-font-style-bf\"\u003ehere\u003c/span\u003e you\u0027re making a mistake and start performing the combo from the beginning), \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027 (\u003cspan class\u003d\"tex-font-style-bf\"\u003enote that at this point you will not perform the combo because of the mistake\u003c/span\u003e), \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\u0027, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ec\u003c/span\u003e\u0027, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027.\u003c/p\u003e\u003cp\u003eYour task is to calculate for each button (letter) the number of times you\u0027ll press it.\u003c/p\u003e\u003cp\u003eYou have to answer $$$t$$$ independent test cases.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains one integer $$$t$$$ ($$$1 \\le t \\le 10^4$$$) — the number of test cases.\u003c/p\u003e\u003cp\u003eThen $$$t$$$ test cases follow.\u003c/p\u003e\u003cp\u003eThe first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$2 \\le n \\le 2 \\cdot 10^5$$$, $$$1 \\le m \\le 2 \\cdot 10^5$$$) — the length of $$$s$$$ and the number of tries correspondingly.\u003c/p\u003e\u003cp\u003eThe second line of each test case contains the string $$$s$$$ consisting of $$$n$$$ lowercase Latin letters.\u003c/p\u003e\u003cp\u003eThe third line of each test case contains $$$m$$$ integers $$$p_1, p_2, \\dots, p_m$$$ ($$$1 \\le p_i \u0026lt; n$$$) — the number of characters pressed right during the $$$i$$$-th try.\u003c/p\u003e\u003cp\u003eIt is guaranteed that the sum of $$$n$$$ and the sum of $$$m$$$ both does not exceed $$$2 \\cdot 10^5$$$ ($$$\\sum n \\le 2 \\cdot 10^5$$$, $$$\\sum m \\le 2 \\cdot 10^5$$$).\u003c/p\u003e\u003cp\u003eIt is guaranteed that the answer for each letter does not exceed $$$2 \\cdot 10^9$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print the answer — $$$26$$$ integers: the number of times you press the button \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027, the number of times you press the button \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\u0027, $$$\\dots$$$, the number of times you press the button \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ez\u003c/span\u003e\u0027.\u003c/p\u003e"}},{"title":"Examples","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\u003e3\n4 2\nabca\n1 3\n10 5\ncodeforces\n2 8 3 2 9\n26 10\nqwertyuioplkjhgfdsazxcvbnm\n20 10 1 2 3 5 10 5 9 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n0 0 9 4 5 3 0 0 0 0 0 0 0 0 9 0 0 3 1 0 0 0 0 0 0 0 \n2 1 1 2 9 2 2 2 5 2 2 2 1 1 5 4 11 8 2 7 5 1 10 1 5 2 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eThe first test case is described in the problem statement. Wrong tries are \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eabc\u003c/span\u003e\" and the final try is \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eabca\u003c/span\u003e\". The number of times you press \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ea\u003c/span\u003e\u0027 is $$$4$$$, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eb\u003c/span\u003e\u0027 is $$$2$$$ and \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ec\u003c/span\u003e\u0027 is $$$2$$$.\u003c/p\u003e\u003cp\u003eIn the second test case, there are five wrong tries: \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eco\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecodeforc\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecod\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eco\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecodeforce\u003c/span\u003e\" and the final try is \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecodeforces\u003c/span\u003e\". The number of times you press \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ec\u003c/span\u003e\u0027 is $$$9$$$, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ed\u003c/span\u003e\u0027 is $$$4$$$, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ee\u003c/span\u003e\u0027 is $$$5$$$, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003ef\u003c/span\u003e\u0027 is $$$3$$$, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003eo\u003c/span\u003e\u0027 is $$$9$$$, \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003er\u003c/span\u003e\u0027 is $$$3$$$ and \u0027\u003cspan class\u003d\"tex-font-style-tt\"\u003es\u003c/span\u003e\u0027 is $$$1$$$.\u003c/p\u003e"}}]}