#include <bits/stdc++.h>
using namespace std;
bool merge(vector<string>& arr, int l, int m, int r) {
  int i, j, k;
  int n1 = m - l + 1;
  int n2 = r - m;
  vector<string> L(n1), R(n2);
  for (i = 0; i < n1; i++) L[i] = arr[l + i];
  for (j = 0; j < n2; j++) R[j] = arr[m + 1 + j];
  i = 0;
  j = 0;
  k = l;
  while (i < n1 && j < n2) {
    std::size_t found = R[j].find(L[i]);
    std::size_t found2 = L[i].find(R[j]);
    if (found != std::string::npos) {
      arr[k] = L[i];
      i++;
    } else if (found2 != std::string::npos) {
      arr[k] = R[j];
      j++;
    } else
      return false;
    k++;
  }
  while (i < n1) {
    arr[k] = L[i];
    i++;
    k++;
  }
  while (j < n2) {
    arr[k] = R[j];
    j++;
    k++;
  }
  return true;
}
bool merge_sort(vector<string>& vec, int start, int end) {
  if (start >= end) {
    return true;
  }
  bool b1 = merge_sort(vec, start, (start + end) / 2);
  bool b2 = merge_sort(vec, (start + end) / 2 + 1, end);
  bool b3 = merge(vec, start, (start + end) / 2, end);
  return b1 && b2 && b3;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  short n, temp;
  cin >> n;
  temp = n;
  std::vector<string> vec;
  while (temp--) {
    cin >> s;
    vec.push_back(s);
  }
  bool b = merge_sort(vec, 0, n - 1);
  if (b) {
    cout << "YES\n";
    for (int i = 0; i < n; i++) {
      cout << vec[i] << endl;
    }
  } else
    cout << "NO\n";
  return 0;
}
