#include <bits/stdc++.h>
using namespace std;
bool comp(string a, string b) { return a.size() < b.size(); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string arr[n];
  for (int i = 0; i < n; ++i) cin >> arr[i];
  sort(arr, arr + n, comp);
  string st = arr[0];
  vector<string> ans;
  set<int> chosen;
  chosen.insert(0);
  while (ans.size() < n) {
    if (ans.size() > 0) {
      int mini = INT_MAX;
      for (int j = 0; j < n; ++j) {
        if (arr[j].find(st) != string::npos) {
          if (arr[j].size() < mini && chosen.find(j) == chosen.end()) {
            chosen.insert(j);
            mini = arr[j].size();
            st = arr[j];
          }
        }
      }
      if (mini == INT_MAX) {
        return cout << "NO\n", 0;
      }
    }
    ans.push_back(st);
  }
  cout << "YES" << endl;
  for (int i = 0; i < ans.size(); ++i) {
    cout << ans[i] << endl;
  }
}
