#include <bits/stdc++.h>
using namespace std;
const int maxn = 101;
int cmp(string a, string b) { return a.size() < b.size(); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  string a[maxn];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n, cmp);
  int flag = 1;
  string::size_type it;
  for (int i = 0; i < n - 1; i++) {
    it = a[i + 1].find(a[i]);
    if (it == a[i + 1].npos) {
      flag = 0;
      break;
    }
  }
  if (flag) {
    cout << "YES" << endl;
    for (int i = 0; i < n; i++) {
      cout << a[i] << endl;
    }
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
