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".
# Python program for implementation of MergeSort
 
# Merges two subarrays of arr[].
# First subarray is arr[l..m]
# Second subarray is arr[m+1..r]
def merge(arr,temp, l, m, r):
    n1 = m - l + 1
    n2 = r- m
 
    # create temp arrays
    L1 = [0] *n1
    L2= [''] *n1
    R1 = [0] *n2
    R2 = [''] *n2
    # Copy data to temp arrays L[] and R[]
    for i in range(0 , n1):
        L1[i] = arr[l + i]
        L2[i] = temp[l + i]
    for j in range(0 , n2):
        R1[j] = arr[m + 1 + j]
        R2[j] = temp[m + 1 + j]
 
    # Merge the temp arrays back into arr[l..r]
    i = 0     # Initial index of first subarray
    j = 0     # Initial index of second subarray
    k = l     # Initial index of merged subarray
 
    while i < n1 and j < n2 :
        if L1[i] <= R1[j]:
            arr[k] = L1[i]
            temp[k]= L2[i]
            i += 1
        else:
            arr[k] = R1[j]
            temp[k]= R2[j]
            j += 1
        k += 1
 
    # Copy the remaining elements of L[], if there
    # are any
    while i < n1:
        arr[k] = L1[i]
        temp[k] = L2[i]
        i += 1
        k += 1
 
    # Copy the remaining elements of R[], if there
    # are any
    while j < n2:
        arr[k] = R1[j]
        temp[k] = R2[j]
        j += 1
        k += 1
 
# l is for left index and r is right index of the
# sub-array of arr to be sorted
def mergeSort(arr,temp,l,r):
    if l < r:
 
        # Same as (l+r)/2, but avoids overflow for
        # large l and h
        m = (l+(r-1))//2
 
        # Sort first and second halves
        mergeSort(arr,temp, l, m)
        mergeSort(arr,temp, m+1, r)
        merge(arr,temp, l, m, r)
# Driver code to test above



n=int(input())
arr=[]
temp=[]
for i in range(n):
    s=str(input())
    arr.append(len(s))
    temp.append(s)
mergeSort(arr,temp,0,n-1)
flag=0
for i in range(1,n):
    if(temp[i-1] in temp[i]):
        pass
    else:
        flag=1
        break
if(flag==1):
    print("NO")
else:
    print("YES")
    for i in range(n):
        print(temp[i])

