#include <bits/stdc++.h>
using namespace std;
bool check(string &s, string &t) {
  for (int i = 0; i + t.size() <= s.size(); ++i) {
    if (s.substr(i, t.size()) == t) return true;
  }
  return false;
}
string s[105];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; cin >> s[i++])
    ;
  sort(s, s + n, [](string &s, string &t) {
    if (s.size() == t.size()) {
      if (s != t) {
        cout << "NO";
        exit(0);
      }
      return &s < &t;
    }
    if (s.size() < t.size()) {
      if (check(t, s)) return true;
      cout << "NO";
      exit(0);
    }
    if (s.size() > t.size()) {
      if (check(s, t)) return false;
      cout << "NO";
      exit(0);
    }
  });
  cout << "YES\n";
  for (int i = 0; i < n; cout << s[i++] << '\n')
    ;
}
