#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
bool cmp(string& a, string& b) { return a.size() < b.size(); }
bool check(string a, string b) {
  if (a.size() == b.size()) return (a == b);
  for (int i = 0; i <= b.size() - a.size(); ++i) {
    bool can = true;
    for (int j = 0; j < a.size(); ++j) {
      if (b[i + j] != a[j]) {
        can = false;
        break;
      }
    }
    if (can) return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  vector<string> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a.begin(), a.end(), cmp);
  bool can = true;
  for (int i = 1; i < n; ++i) {
    if (check(a[i - 1], a[i]) == false) can = false;
  }
  if (!can)
    cout << "NO";
  else {
    cout << "YES" << '\n';
    for (string x : a) cout << x << '\n';
  }
  return 0;
}
