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".
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Sort {

	public static int[] getArray(int size) {
		int[] array = new int[size];
		for (int i = 0; i < size; i++) {
			array[i] = sr.nextInt();
		}
		return array;
	}

	public static int[][] getMatrix(int sizeI, int sizeJ) {
		int[][] array = new int[sizeI][sizeJ];
		for (int i = 0; i < sizeI; i++) {
			for (int j = 0; j < sizeJ; j++) {
				array[i][j] = sr.nextInt();
			}
		}
		return array;
	}

	public static boolean isSimpleNumber(int val) {
		for (int i = 2; i <= Math.sqrt(val); i++) {
			if (val % i == 0)
				return false;
		}
		return true;
	}

	public static int NOD(int a, int b) {
		while (a != 0 && b != 0) {
			if (a > b) {
				a = a % b;
			} else {
				b = b % a;
			}
		}
		return a + b;
	}

	public static int NOK(int a, int b) {
		return a * b / NOD(a, b);
	}

	public static long factorial(int i) {
		long res = 1;
		for (int j = 2; j <= i; j++) {
			res *= j;
		}
		return res;
	}

	static char letters[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
			's', 't', 'u', 'v', 'w', 'x', 'y', 'z' };

	static Scanner sr = new Scanner(System.in);

	public static void main(String[] args) {

		int n = sr.nextInt();
		sr.nextLine();
		String lines[] = new String[n];
		
		for (int i = 0; i < lines.length; i++) {
			lines[i] = sr.nextLine();
		}
		
		for (int i = 0; i < lines.length; i++) {
			int max = Integer.MAX_VALUE;
			int iMax = i;
			for (int j = i; j < lines.length; j++) {
				if (lines[j].length() < max) {
					max = lines[j].length();
					iMax = j;
				}
			}
			String temp = lines[i];
			lines[i] = lines[iMax];
			lines[iMax] = temp;
		}
		boolean isOK = true;
		for (int i = 1; i < lines.length; i++) {
			if (!lines[i].contains(lines[i - 1])) {
				isOK = false;
				break;
			}
		}
		if (isOK) {
			System.out.println("YES");
			for (int i = 0; i < lines.length; i++) {
				System.out.println(lines[i]);
			}
		} else {
			System.out.println("NO");
		}

		
	}
}