#include <bits/stdc++.h>
using namespace std;
bool compare(string &s1, string &s2) { return s1.size() < s2.size(); }
void solve() {
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; i++) cin >> s[i];
  sort(s.begin(), s.end(), compare);
  for (int i = 0; i < n - 1; i++)
    if (s[i + 1].find(s[i]) == -1) {
      cout << "NO\n";
      return;
    }
  cout << "YES\n";
  for (int i = 0; i < n; i++) cout << s[i] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
