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".
# # G - wrong
# from fractions import Fraction


# def gen(n):
#     a, b = 1, 4
#     for i in range(n):
#         yield a
#         a, b = b, 4 * b - 2 * a


# N = 30000
# m = 0
# p = Fraction(75, 100)

# for i, n in enumerate(gen(N)):
#     if i and i % 1000 == 0:
#         print(i, float(m))
#     P = n * (p**(i + 3) * (1 - p)**i + p**i * (1 - p)**(i + 3))
#     # print((2 * i + 3), float(P))
#     m += (2 * i + 3) * P

# print(float(m))

# from random import random
# import numpy as np


# def simulate():
#     k = 3
#     p = 0.25
#     n_steps = 0
#     while 0 < k < 6:
#         n_steps += 1
#         if random() < p:
#             k -= 1
#         else:
#             k += 1
#     return n_steps


# a = [simulate() for i in range(100000000)]
# print(np.mean(a), 39 / 7)


# # J
# n = int(input())
# a = list(map(int, input().split()))
# print(len(a) - len(set(a)))

# # K
# n = int(input())
# a = list(map(int, input().split()))
# n, r, s = 1, 0, 0
# for d in a[1:]:
#     nn = 1 + n + d
#     rr = n + r + d
#     ss = s + rr + d * (2 * n + r + d - 1)
#     n, r, s = nn, rr, ss
# print(s % 1000000007)


# # L
# from collections import Counter

# M = 1000000007


# def factorized_factorial(n):
#     r = Counter()
#     for p in primes:
#         if p > n:
#             continue
#         d = p
#         while d <= n:
#             r[p] += n // d
#             d *= p
#     return r


# def factorized_binomial(n, k):
#     r = factorized_factorial(n)
#     r -= factorized_factorial(k)
#     r -= factorized_factorial(n - k)
#     return r


# def gcd(a, b, m=M):
#     res = 1
#     for p in a & b:
#         res *= pow(p, min(a[p], b[p]), M)
#         res %= M
#     return res


# k, n = list(map(int, input().split()))
# l, m = list(map(int, input().split()))

# N = max(n, m)
# primes = [True for i in range(N + 1)]
# primes[0] = False
# primes[1] = False
# for i in range(2, N + 1):
#     if primes[i]:
#         for j in range(i ** 2, N + 1, i):
#             primes[j] = False
# primes = [i for (i, p) in enumerate(primes) if p]

# a = factorized_binomial(n, k)
# b = factorized_binomial(m, l)
# print(gcd(a, b))

def f(a):
    for i, si in enumerate(a):
        for j, sj in enumerate(a):
            if sj not in si:
                break
        else:
            return i, si
    return None, None


n = int(input())
s = []
for i in range(n):
    s.append(input().strip())
res = []
while s:
    i, si = f(s)
    if i == None:
        break
    res.append(si)
    del s[i]
if len(res) != n:
    print('NO')
else:
    print('YES')
    for s in res[::-1]:
        print(s)
