{"raw_statement":[{"iden":"statement","content":"A substring of some string is called the most frequent, if the number of its occurrences is not less than number of occurrences of any other substring.\n\nYou are given a set of strings. A string (not necessarily from this set) is called good if all elements of the set are the most frequent substrings of this string. Restore the non-empty good string with minimum length. If several such strings exist, restore lexicographically minimum string. If there are no good strings, print \"_NO_\" (without quotes).\n\nA substring of a string is a contiguous subsequence of letters in the string. For example, \"_ab_\", \"_c_\", \"_abc_\" are substrings of string \"_abc_\", while \"_ac_\" is not a substring of that string.\n\nThe number of occurrences of a substring in a string is the number of starting positions in the string where the substring occurs. These occurrences could overlap.\n\nString _a_ is lexicographically smaller than string _b_, if _a_ is a prefix of _b_, or _a_ has a smaller letter at the first position where _a_ and _b_ differ."},{"iden":"input","content":"The first line contains integer _n_ (1 ≤ _n_ ≤ 105) — the number of strings in the set.\n\nEach of the next _n_ lines contains a non-empty string consisting of lowercase English letters. It is guaranteed that the strings are distinct.\n\nThe total length of the strings doesn't exceed 105."},{"iden":"output","content":"Print the non-empty good string with minimum length. If several good strings exist, print lexicographically minimum among them. Print \"_NO_\" (without quotes) if there are no good strings."},{"iden":"examples","content":"Input\n\n4\nmail\nai\nlru\ncf\n\nOutput\n\ncfmailru\n\nInput\n\n3\nkek\npreceq\ncheburek\n\nOutput\n\nNO"},{"iden":"note","content":"One can show that in the first sample only two good strings with minimum length exist: \"_cfmailru_\" and \"_mailrucf_\". The first string is lexicographically minimum."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":null,"simple_statement":null,"has_page_source":false}