#include <bits/stdc++.h>
using namespace std;
long long n, i, j, k;
string s1;
pair<long long, string> s[151];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> s[i].second;
    s[i].first = s[i].second.size();
  }
  sort(s + 1, s + n + 1);
  for (i = 2; i <= n; i++) {
    if (s[i].second.find(s[i - 1].second) == string::npos) {
      cout << "NO" << '\n';
      return 0;
    }
  }
  cout << "YES" << '\n';
  for (i = 1; i <= n; i++) {
    cout << s[i].second << '\n';
  }
  return 0;
}
