#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, t, n, k, cnt = 0;
  scanf("%lld", &n);
  vector<string> v(n);
  string s;
  bool flag = true;
  for (i = 0; i < n; i++) {
    cin >> s;
    j = i - 1;
    while (j >= 0 && v[j].find(s) != string::npos) {
      v[j + 1] = v[j];
      j--;
    }
    if (j >= 0) {
      if (s.find(v[j]) == string::npos) {
        flag = false;
      }
    }
    v[j + 1] = s;
  }
  if (flag) {
    printf("YES\n");
    for (i = 0; i < n; i++) {
      cout << v[i] << "\n";
    }
  } else {
    printf("NO\n");
  }
  return 0;
}
