#include <bits/stdc++.h>
using namespace std;
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;
}
void sort(string s[], int n) {
  for (int i = 1; i < n; i++) {
    string temp = s[i];
    int j = i - 1;
    while (j >= 0 && temp.length() < s[j].length()) {
      s[j + 1] = s[j];
      j--;
    }
    s[j + 1] = temp;
  }
}
int main() {
  long long n;
  cin >> n;
  string s[n];
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
  }
  sort(s, n);
  long long sum = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (isSubstring(s[i], s[i + 1]) == -1) {
      sum += 0;
    } else {
      sum++;
    }
  }
  if (sum == n - 1) {
    cout << "YES"
         << "\n";
    for (long long i = 0; i < n; i++) {
      cout << s[i] << "\n";
    }
  } else {
    cout << "NO"
         << "\n";
  }
}
