#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t = 0, t1 = 0, lmax = 0;
  cin >> n;
  string s[n], s1[n], smax;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (s[i].length() > s[j].length()) {
        string temp = s[i];
        s[i] = s[j];
        s[j] = temp;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    t = 0;
    for (int j = i + 1; j < n; j++) {
      if (s[j].find(s[i]) == string ::npos) {
        t++;
      }
    }
    if (t == 0) {
      t1++;
    } else
      break;
  }
  if (t1 == n) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) cout << s[i] << endl;
  } else
    cout << "NO\n";
}
