#include <bits/stdc++.h>
using namespace std;
string s[101];
int main() {
  int n;
  bool flag = true;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  sort(s, s + n, [](const string &a, const string &b) {
    return a.length() < b.length();
  });
  for (int i = 1; i < n; ++i) {
    if (s[i].find(s[i - 1]) == string::npos) {
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "YES" << endl;
    for (int i = 0; i < n; ++i) {
      cout << s[i] << endl;
    }
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
