#include <bits/stdc++.h>
using namespace std;
bool cmp(string a, string b) { return a.length() < b.length(); }
bool check(string a, string b) {
  for (int i = 0; i < b.length() - a.length() + 1; ++i) {
    bool ok = true;
    for (int j = 0; j < a.length(); ++j)
      if (b[i + j] != a[j]) ok = false;
    if (ok) return true;
  }
  return false;
}
int main(int argc, char const *argv[]) {
  int n;
  vector<string> a;
  string s;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    a.push_back(s);
  }
  sort(a.begin(), a.end(), cmp);
  bool ok = true;
  for (int i = 1; i < n; ++i) ok = ok & check(a[i - 1], a[i]);
  if (ok) {
    cout << "YES" << endl;
    for (int i = 0; i < n; ++i) cout << a[i] << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
