#include <bits/stdc++.h>   using namespace std;   int TEST, CASE = 1;   int n, m, a, b, c, k, x, y, z, len, total = 0;   string s, temp, ans;   vector<string> v;   bool cmp(string &a, string &b) {     if (a.size() < b.size())       return true;     else       return false;   }   int main(void) {     cin >> n;     for (int i = 0; i < n; i++) cin >> s, v.push_back(s);     sort(v.begin(), v.end(), cmp);     for (int i = 1; i < n; i++) {       if (v[i].find(v[i - 1]) > v[i].size()) {         cout <<  NO  << endl;         return 0;       }     }     cout <<  YES  << endl;     for (int i = 0; i < n; i++) cout << v[i] << endl;     return 0;   }   