#include <bits/stdc++.h>
using namespace std;
int isSubstring(string s1, string s2);
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<pair<int, string>> st(n);
  for (int i = 0; i < n; i++) {
    int l;
    string s;
    cin >> s;
    st[i] = make_pair(s.length(), s);
  }
  sort(st.begin(), st.end());
  bool f = true;
  vector<pair<int, string>> r;
  for (int i = 0; i < n; i++) {
    int c = 0;
    for (int j = i; j < n; j++) {
      if (isSubstring(st[i].second, st[j].second) != -1)
        c++;
      else {
        f = false;
        break;
      }
    }
    if (c != 0) r.push_back(make_pair(c, st[i].second));
    if (f == false) break;
  }
  sort(r.begin(), r.end());
  if (f) {
    cout << "YES\n";
    for (int i = r.size() - 1; i >= 0; i--) cout << r[i].second << endl;
  } else
    cout << "NO\n";
}
int isSubstring(string s1, string s2) {
  int M = s1.length();
  int N = s2.length();
  for (int i = 0; i <= N - M; i++) {
    int j;
    for (j = 0; j < M; j++)
      if (s2[i + j] != s1[j]) break;
    if (j == M) return i;
  }
  return -1;
}
