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".
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * @author Rohini Chandra
 */
import java.util.*;
import java.io.*;
public class NewClass{
    public static void main(String args[]) throws IOException{
       /*BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       PrintWriter pw = new PrintWriter(System.out);*/
       //List<Integer> list = new ArrayList<>();
       //Map<Integer,Integer> map = new HashMap<>();
       //Set<Integer> set = new HashSet<>();
       Scanner sc = new Scanner(System.in);
       int n = sc.nextInt(); 
       List<Integer> list = new ArrayList<>();
       List<String> asc = new ArrayList<>();
       Map<Integer,List<String>> map = new TreeMap<>();
       for(int i=0; i<n; i++){
           String str = sc.next();
           if(!map.containsKey(str.length()))
              map.put(str.length(), new ArrayList<>());
           map.get(str.length()).add(str);
       }
       list.addAll(map.keySet());
       for(int i=0; i<map.size(); i++){
          if(!map.get(list.get(i)).isEmpty())
             asc.addAll(map.get(list.get(i)));
       }
       //System.out.print(asc);
       boolean bool=false;
       int c=1;
       for(int i=1; i<n; i++){
          if(!asc.get(i).contains(asc.get(i-1))){
             bool=false; 
             break;
          }
          bool = true;
       }
       if(bool==false && n>1)
           System.out.print("NO");
       else{
           System.out.println("YES");
           for(String x : asc)
               System.out.println(x);
       }
    }
                                        //******** PRINT ********//
    static void prt(int a){
       System.out.print(a);
    }
                                       //******** PRINTLN ********//
    static void prtl(int b){
       System.out.println(b); 
    }         
                                       //******** FACTORIAL ********//
    static int fact(int n){
       if(n==1)
          return 1;
       else
          return n*fact(n-1);
    }
                                       //******** OCCURRENCE ********//
    static Map<String,Integer> ocr(String str[]){
           Map<String,Integer> map = new HashMap<>();
           for(int i=0; i<str.length; i++){
           if(!map.containsKey(str[i]))
              map.put(str[i], 1);
           else
              map.put(str[i], map.get(str[i])+1);
           }
           return map;
    }
                                        //******** PRIME OR NOT ********//
    static boolean isprime(long num){
        if(num<=1)
            return false;
        else if(num<=3)
            return true;
        else if(num%2==0 || num%3==0)
            return false;
        else{
            for(int i=5; i*i<=num; i+=6){
                if(num%i==0 || num%(i+2)==0)
                   return false; 
            }
            return true;
        }
    }
                                       //******** GCD ************//
    static long gcd(long a, long b){
         if(b==0)
            return a;
         else if(a==0)
            return b;  
         else if(a>b)
            gcd(a%b,b);
         else if(a<b)
            gcd(a,b%a);
         else if(a==b)
            return a;
         return 0;
    }
}
