{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eInnokenty is a president of a new football league in Byteland. The first task he should do is to assign short names to all clubs to be shown on TV next to the score. Of course, the short names should be distinct, and Innokenty wants that all short names consist of \u003cspan class\u003d\"tex-font-style-bf\"\u003ethree letters\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eEach club\u0027s full name consist of two words: the team\u0027s name and the hometown\u0027s name, for example, \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eDINAMO BYTECITY\u003c/span\u003e\". Innokenty doesn\u0027t want to assign strange short names, so he wants to choose such short names for each club that: \u003c/p\u003e\u003col\u003e \u003cli\u003e the short name is the same as three first letters of the team\u0027s name, for example, for the mentioned club it is \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eDIN\u003c/span\u003e\", \u003c/li\u003e\u003cli\u003e or, the first two letters of the short name should be the same as the first two letters of the team\u0027s name, while the third letter is the same as the first letter in the hometown\u0027s name. For the mentioned club it is \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eDIB\u003c/span\u003e\". \u003c/li\u003e\u003c/ol\u003e\u003cp\u003eApart from this, there is a rule that if for some club \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e the second option of short name is chosen, then there should be no club, for which the first option is chosen which is the same as the first option for the club \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e. For example, if the above mentioned club has short name \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eDIB\u003c/span\u003e\", then no club for which the first option is chosen can have short name equal to \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eDIN\u003c/span\u003e\". However, it is possible that some club have short name \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eDIN\u003c/span\u003e\", where \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eDI\u003c/span\u003e\" are the first two letters of the team\u0027s name, and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eN\u003c/span\u003e\" is the first letter of hometown\u0027s name. Of course, no two teams can have the same short name.\u003c/p\u003e\u003cp\u003eHelp Innokenty to choose a short name for each of the teams. If this is impossible, report that. If there are multiple answer, any of them will suit Innokenty. If for some team the two options of short name are equal, then Innokenty will formally think that only one of these options is chosen. \u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a 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 ≤ 1000\u003c/span\u003e)\u0026nbsp;— the number of clubs in the league.\u003c/p\u003e\u003cp\u003eEach of the next \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e lines contains two words\u0026nbsp;— the team\u0027s name and the hometown\u0027s name for some club. Both team\u0027s name and hometown\u0027s name consist of uppercase English letters and have length at least \u003cspan class\u003d\"tex-span\"\u003e3\u003c/span\u003e and at most \u003cspan class\u003d\"tex-span\"\u003e20\u003c/span\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIt it is not possible to choose short names and satisfy all constraints, print a single line \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e\".\u003c/p\u003e\u003cp\u003eOtherwise, in the first line print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e\". Then print \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e lines, in each line print the chosen short name for the corresponding club. Print the clubs in the same order as they appeared in input.\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\u003e2\nDINAMO BYTECITY\nFOOTBALL MOSCOW\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nDIN\nFOO\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\nDINAMO BYTECITY\nDINAMO BITECITY\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO\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\u003e3\nPLAYFOOTBALL MOSCOW\nPLAYVOLLEYBALL SPB\nGOGO TECHNOCUP\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nPLM\nPLS\nGOG\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\u003e3\nABC DEF\nABC EFG\nABD OOO\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\nABD\nABE\nABO\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\u003eIn the first sample Innokenty can choose first option for both clubs.\u003c/p\u003e\u003cp\u003eIn the second example it is not possible to choose short names, because it is not possible that one club has first option, and the other has second option if the first options are equal for both clubs.\u003c/p\u003e\u003cp\u003eIn the third example Innokenty can choose the second options for the first two clubs, and the first option for the third club.\u003c/p\u003e\u003cp\u003eIn the fourth example note that it is possible that the chosen short name for some club \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e is the same as the first option of another club \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ey\u003c/i\u003e\u003c/span\u003e if the first options of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ey\u003c/i\u003e\u003c/span\u003e are different.\u003c/p\u003e"}}]}