You are given n strings. Each string consists of lowercase English letters. Rearrange (reorder) the given strings in such a way that for every string, all strings that are placed before it are its substrings.

String a is a substring of string b if it is possible to choose several consecutive letters in b in such a way that they form a. For example, string "for" is contained as a substring in strings "codeforces", "for" and "therefore", but is not contained as a substring in strings "four", "fofo" and "rof".

Input

The first line contains an integer n (1 ≤ n ≤ 100) — the number of strings.

The next n lines contain the given strings. The number of letters in each string is from 1 to 100, inclusive. Each string consists of lowercase English letters.

Some strings might be equal.

Output

If it is impossible to reorder n given strings in required order, print "NO" (without quotes).

Otherwise print "YES" (without quotes) and n given strings in required order.

Examples

Input

5
a
aba
abacaba
ba
aba


Output

YES
a
ba
aba
aba
abacaba


Input

5
a
abacaba
ba
aba
abab


Output

NO


Input

3
qwerty
qwerty
qwerty


Output

YES
qwerty
qwerty
qwerty

Note

In the second example you cannot reorder the strings because the string "abab" is not a substring of the string "abacaba".
def sortStrings(array):
    dic = {}
    for i in range(len(array)):
        size = len(array[i])
        if size not in dic.keys():
            dic[size] = []
            dic[size].append(array[i])
        else:
            dic[len(array[i])].append(array[i])
    keys = dic.keys()
    keys_ord = sorted(keys)
    array_ord = []
    for key in keys_ord:
        for string in dic[key]:
            array_ord.append(string)
    return array_ord

n = int(raw_input())
strings = []
for i in range(n):
    string = raw_input()
    strings.append(string)
strings_ord = sortStrings(strings)
boolean = True
for i in xrange(len(strings_ord)-1):
    if strings_ord[i] not in strings_ord[i+1]:
        boolean = False
        break
if boolean:
    print "YES"
    for value in strings_ord:
        print value
else:
    print "NO"
