#include <bits/stdc++.h>
using namespace std;
string s[105];
bool cmp(string a, string b) {
  if (a.size() == b.size()) {
    return a < b;
  } else
    return a.size() < b.size();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
  }
  sort(s + 1, s + 1 + n, cmp);
  int p = 0;
  for (int i = 2; i <= n; i++) {
    if (s[i].find(s[i - 1]) == -1) {
      p = 1;
      break;
    }
  }
  if (p == 0) {
    cout << "YES" << endl;
    for (int i = 1; i <= n; i++) {
      cout << s[i] << endl;
    }
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
