{"trustable":false,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\nXiao t thanks you very much for helping to solve his last problem. However, the virus invasion continues. With the unremitting efforts of Xiao t, he discovered the \"source of all evil\" in the Internet. \n\u003cbr\u003eThis is a huge virus website, it has many viruses, but the viruses contained in this website are very strange, the signature code of these viruses is very short, and only contains English uppercase characters. Of course, Xiao t really wanted to kill the people, but Xiao t never fought unprepared wars. \n\u003cbr\u003eKnowing oneself and knowing the enemy is important, so the first thing Xiao t wants to do is to know the characteristics of this virus site: how many different viruses it contains and how many times each virus appears. Can everyone help him again?\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cb\u003eThis problem contains multiple datasets.\u003c/b\u003e\n\u003cbr\u003eThe first line of each dataset contains an integer n (1 \u0026le; n \u0026le; 1000), indicates the number of virus signatures. \n\u003cbr\u003eFor the next n lines, each line represents a virus signature, the signature string length is between 1 and 50, and only contains English uppercase characters. Two different virus signatures will be different. \n\u003cbr\u003eAfter this line, it indicates the source code of the \"source of all evil\" website, and the length of the source code string is within 2000000. The characters in the string are all visible characters in ASCII code (excluding carriage return).\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Print the number of occurrences of each virus one per line. Viruses that do not appear do not need to be printed. Use the following format:\n\u003cbr\u003e(Virus signature): (Number of occurrences)\n\u003cbr\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e3\nAA\nBB\nCC\nooxxCC%dAAAoen....END\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eAA: 2\nCC: 1\n\n \n \u003ci style\u003d\"font-size:1px\"\u003e \u003c/i\u003e\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cpre\u003e\nHint:\nAll situations not mentioned in the topic description should be considered. For example, two virus signatures may have mutually overlapping or overlapping signature segments. \nThe counting strategy can also be inferred from the Sample to a certain extent.\n \u003c/pre\u003e"}}]}