#include <bits/stdc++.h>
using namespace std;
int n;
bool check = 1;
vector<string> vec;
vector<string> tes[101];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string tmp;
    cin >> tmp;
    tes[tmp.size()].push_back(tmp);
  }
  for (int i = 0; i < 101; i++) {
    if (tes[i].size() != 0) {
      for (int j = 0; j < tes[i].size(); j++) vec.push_back(tes[i][j]);
    }
  }
  for (int i = 0; i < n - 1; ++i) {
    if (vec[i + 1].find(vec[i]) == string::npos) {
      check = 0;
      break;
    }
  }
  if (check) {
    cout << "YES\n";
    for (int i = 0; i < n; ++i) cout << vec[i] << "\n";
  } else {
    cout << "NO\n";
  }
}
