{"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\u003eRecently Vladik discovered a new entertainment\u0026nbsp;— coding bots for social networks. He would like to use machine learning in his bots so now he want to prepare some learning data for them.\u003c/p\u003e\u003cp\u003eAt first, he need to download \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e chats. Vladik coded a script which should have downloaded the chats, however, something went wrong. In particular, some of the messages have no information of their sender. It is known that if a person sends several messages in a row, they all are merged into a single message. It means that \u003cspan class\u003d\"tex-font-style-bf\"\u003ethere could not be two or more messages in a row with the same sender\u003c/span\u003e. Moreover, \u003cspan class\u003d\"tex-font-style-bf\"\u003ea sender never mention himself in his messages\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eVladik wants to recover senders of all the messages so that each two neighboring messages will have different senders and no sender will mention himself in his messages.\u003c/p\u003e\u003cp\u003eHe has no idea of how to do this, and asks you for help. Help Vladik to recover senders in each of the chats!\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains single integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003et\u003c/i\u003e ≤ 10\u003c/span\u003e) — the number of chats. The \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e chats follow. Each chat is given in the following format.\u003c/p\u003e\u003cp\u003eThe first line of each chat description contains single integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 100\u003c/span\u003e)\u0026nbsp;— the number of users in the chat.\u003c/p\u003e\u003cp\u003eThe next line contains \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e space-separated distinct usernames. Each username consists of lowercase and uppercase English letters and digits. The usernames can\u0027t start with a digit. Two usernames are different even if they differ only with letters\u0027 case. The length of username is positive and doesn\u0027t exceed \u003cspan class\u003d\"tex-span\"\u003e10\u003c/span\u003e characters.\u003c/p\u003e\u003cp\u003eThe next line contains single integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003em\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003em\u003c/i\u003e ≤ 100\u003c/span\u003e)\u0026nbsp;— the number of messages in the chat. The next \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003em\u003c/i\u003e\u003c/span\u003e line contain the messages in the following formats, one per line: \u003c/p\u003e\u003cul\u003e \u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0026lt;username\u0026gt;:\u0026lt;text\u0026gt;\u003c/span\u003e\u0026nbsp;— the format of a message with known sender. The username should appear in the list of usernames of the chat. \u003c/li\u003e\u003cli\u003e \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0026lt;?\u0026gt;:\u0026lt;text\u0026gt;\u003c/span\u003e\u0026nbsp;— the format of a message with unknown sender. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThe text of a message can consist of lowercase and uppercase English letter, digits, characters \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027.\u0027\u003c/span\u003e (dot), \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027,\u0027\u003c/span\u003e (comma), \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027!\u0027\u003c/span\u003e (exclamation mark), \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027?\u0027\u003c/span\u003e (question mark) and \u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0027 \u0027\u003c/span\u003e (space). The text doesn\u0027t contain trailing spaces. The length of the text is positive and doesn\u0027t exceed \u003cspan class\u003d\"tex-span\"\u003e100\u003c/span\u003e characters.\u003c/p\u003e\u003cp\u003eWe say that a text mention a user if his username appears in the text as a word. In other words, the username appears in a such a position that the two characters before and after its appearance either do not exist or are not English letters or digits. For example, the text \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eVasya, masha13 and Kate!\u003c/span\u003e\" can mention users \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eVasya\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003emasha13\u003c/span\u003e\", \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eand\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eKate\u003c/span\u003e\", but not \"\u003cspan class\u003d\"tex-font-style-tt\"\u003emasha\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eIt is guaranteed that in each chat \u003cspan class\u003d\"tex-font-style-bf\"\u003eno known sender mention himself in his messages\u003c/span\u003e and there are no two neighboring messages with the same known sender.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint the information about the \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e chats in the following format:\u003c/p\u003e\u003cp\u003eIf it is not possible to recover senders, print single line \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eImpossible\u003c/span\u003e\" for this chat. Otherwise print \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003em\u003c/i\u003e\u003c/span\u003e messages in the following format:\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-tt\"\u003e\u0026lt;username\u0026gt;:\u0026lt;text\u0026gt;\u003c/span\u003e\u003c/p\u003e\u003cp\u003eIf there are multiple answers, print any of them.\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\u003e1\n2\nVladik netman\n2\n?: Hello, Vladik!\n?: Hi\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003enetman: Hello, Vladik!\nVladik: Hi\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e1\n2\nnetman vladik\n3\nnetman:how are you?\n?:wrong message\nvladik:im fine\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eImpossible\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e2\n3\nnetman vladik Fedosik\n2\n?: users are netman, vladik, Fedosik\nvladik: something wrong with this chat\n4\nnetman tigerrrrr banany2001 klinchuh\n4\n?: tigerrrrr, banany2001, klinchuh, my favourite team ever, are you ready?\nklinchuh: yes, coach!\n?: yes, netman\nbanany2001: yes of course.\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eImpossible\nnetman: tigerrrrr, banany2001, klinchuh, my favourite team ever, are you ready?\nklinchuh: yes, coach!\ntigerrrrr: yes, netman\nbanany2001: yes of course.\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}