{"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\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":"Mr. Shahriar Younus Ashik one of the greatest competitive programmers of IIUC. He didn\u0027t give his online judge handle to anyone. But all of the competitive programmers of IIUC are interested to know the online judge handle of Ashik. One day Ashik makes a plan. The plan is he gives you some N string S\u003csub\u003e1\u003c/sub\u003e, S\u003csub\u003e2\u003c/sub\u003e, S\u003csub\u003e3\u003c/sub\u003e, ....., S\u003csub\u003eN\u003c/sub\u003e. \u003c/br\u003e\u003c/br\u003e\nIn one operation you can remove a character from a string S\u003csub\u003ei\u003c/sub\u003e and insert it to an arbitrary position in a string S\u003csub\u003ej\u003c/sub\u003e (j may be equal to i). You may perform this operation any number of times. If you make all N strings equal then Ashik will give his online judge handle to you otherwise not."}},{"title":"Input","value":{"format":"HTML","content":"The first line contains t (1≤t≤10): the number of test cases.\n\u003c/br\u003e\nThe first line of each test case contains a single integer N (1≤N≤1000): \nthe number of strings.\n\u003c/br\u003e\nN lines follow, the i-th line contains S\u003csub\u003ei\u003c/sub\u003e (1≤|S\u003csub\u003ei\u003c/sub\u003e|≤1000).\n\u003c/br\u003e\nThe sum of lengths of all strings in all test cases does not exceed 1000."}},{"title":"Output","value":{"format":"HTML","content":"If it is possible to know the online judge handle of Ashik print \u0027YES\u0027 otherwise \u0027NO\u0027."}},{"title":"Example","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e4\n2\ncaa\ncbb\n3\ncba\ncba\ncbb\n4\nccab\ncbac\nbca\nacbcc\n4\nacb\ncaf\nc\ncbafc\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eYES\nNO\nYES\nNO\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, you can do the following: \u003c/p\u003e\n\u003cul\u003e \n \u003cli\u003e Remove the third character of the first string and insert it after the second character of the second string, making the two strings \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eca\u003c/span\u003e\" and \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecbab\u003c/span\u003e\" respectively.\u003c/li\u003e\n \u003cli\u003e Remove the second character of the second string and insert it after the second character of the first string, making both strings equal to \"\u003cspan class\u003d\"tex-font-style-tt\"\u003ecab\u003c/span\u003e\". \u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eIn the second test case, it is impossible to make all N strings equal.\u003c/p\u003e"}}]}