#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e2 + 100;
const int INF = 0x3FFFFFFF;
const long long MOD = 1e5 + 7;
struct S {
  string s;
} a[MAXN];
bool cmp(S a, S b) { return a.s.length() < b.s.length(); }
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i].s;
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      size_t found = a[j].s.find(a[i].s);
      if (found == string::npos) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= n; i++) cout << a[i].s << endl;
  return 0;
}
