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